Rest assured I have not played any of those courses ever, and if you are a golfer, your efforts certainly would earn you an invite to one of them if I had anything to say about it.
Your shot value data could have the club ID and the distance as separate fields then you simply join on both from your shot record data.
Was this not demonstrated here a long time ago.If I understand you correctly, the problem there is there is no guarantee as to what club you are using for a given shot. F150 may be an 8 iron one day, and a 6 iron the next. The wind, elevation, where you want to leave your shot all play into what club you hit.
On the input form you input the distance you have to the pin on its own, and in the separate field input the lie. The query then joins them into the format of the shot values table in order to match up with the correct value.
Was this not demonstrated here a long time ago.
Post in thread 'Fields and records moving about?' https://www.access-programmers.co.u...-and-records-moving-about.326250/post-1862417
Seems like this whole thread is starting over from the beginning and just rehashing the same things already discussed and demonstrated.
Clubs |
---|
D |
3w |
3h |
4i |
5i |
6i |
7i |
8i |
9i |
PW |
52W |
56W |
60W |
P |
5h |
ClubID | Clubs |
---|---|
1 | D |
2 | 3w |
3 | 3h |
4 | 4i |
5 | 5i |
6 | 6i |
7 | 7i |
8 | 8i |
9 | 9i |
10 | PW |
11 | 52W |
12 | 56W |
13 | 60W |
14 | P |
15 | 5h |
Category | Choice |
---|---|
Shot Type | Tee Shot |
Shot Type | Approach |
Shot Type | Penalty |
Shot Type | Short Game |
Shot Type | Putt |
Shot Type | Recovery |
Club Name | D |
Club Name | 3w |
Club Name | 3h |
Club Name | 4i |
Club Name | 5i |
Club Name | 6i |
Club Name | 7i |
Club Name | 8i |
Club Name | 9i |
So I opened the DB and you are storing the Lookup values and not the Primary key for your 3 lookup tables. Personally I would leave it, as long as you review the above thread and understand potential pros and cons. So if you leave it the discussion of referential integrity is not relevant since there is no relation to the lookups. There is one place you are not consistent. In the Round table you are storing a course name. Courses are different than these other single field "lookup tables". I course has several fields of information which makes it more a "data table". Courses have additional information. In the shot table you store the CourseID as foreign key which is correct, but you are storing the name in the Round table where you should store a courseID_FK.
Also look at my examples for Main form and Subform. I doubt any is going to want to enter 18 holes for a golf course (hole data) in single form view, with no idea of what has been entered and which course you are referring to. You would have a main form with the ability to select a Course at the top and a continuous form for the holes.
View attachment 107031
1. I doubt it will have any impact on running reports. For sure I see no way that would make it easierI should have not only referential integrity but also an easier time running reports.
ID | Lie |
---|---|
1 | T |
2 | F |
3 | R |
4 | RE |
5 | S |
6 | G |
Lie_ID |
---|
F |
G |
R |
RE |
S |
T |
ShotValueID | TypeandDistance | BaselineStrokes |
---|---|---|
302 | T401 | 3.99 |
Lie_FK | DistanceToPin | BaselineStrokes |
---|---|---|
1 | 401 | 3.99 |
I think you missed the point. In the data table you are now storing a DistanceToPin and a Lie_FK. Your shot value table is then wrong you cannot join on that.
tblShotValues tblShotValues
You need to update it to look like this
ShotValueID TypeandDistance BaselineStrokes 302 T401 3.99
tblShot_Values tblShot_Values
Lie_FK DistanceToPin BaselineStrokes 1 401 3.99
Now a T shot at 401 is stored in the data table as
1 401
and that will join to the tblShotValues by joining on two fields, lie_FK and DistanceToPin.
No. You will join on two fields not just the distance field. Look at my demo where I already do this.