Christine
If you use the tick box approach, you may run into two problems down the road....
- The number of tick boxes are going to grow and grow as new players come on board. What do you do with the old palyers? If you substitute a new player for an exiting player, then the sessions for the exiting player will be assumed by new player. And in the future, how will you delete old data? You will be making changes to your database / table design to accomodate a normal process.
- Creating the reports and designing the SQL statements can get real rough.
In short, yes, you do create on "transaction" for each player who attends one session. This shows up in the "join" table as so neatly depicted by Kevin. However, now you will not have to change designs to accomodate transition. And you delete historical data with minimal impact.
On to the form design...
Kevin has explained this. For data entry, you will want to use the session table as the main table. This should be fairly easy using the Forms wizard. After the wizard has created the intial form, get creative -- add a title. But keep in mind where and how you want to display the players.
It boils down to real estate; some considerations...
- Most common approach is to have the main form on top and the subform at the bottom.
- Consider keeping the session information on the left side of teh form and the playn to display the player or players on the left. Why? You will probably be using a continuous form for the player subform and Access more easily displays a single column(s) of data than a double column type of thing.
- Maybe a tab form may work. Have the basic session info on top, additional session on the first tab and the players listed on the second tab.
Subform - I suspect you will less choices here. As indicated by Kevin, the subform will use tblSessionProfile.
- Probably want to make the form continuous.
- If linking to the session table, make the sessionID field invisible, and shrink it.
- The playerID field will best work with a combo box pointing to the player table.
Hint: Instead of creating a combo box, I prefer to do some "pre-work" in the table design. In the table design mode, select the player IF field. Near the bottom of the design screen, click on the Lookup tab. Change the display control from text box to combo box. For row source point to the player table. When in the row source field, click on the "..." button to run the query design wizard. Select player name for the 1st column, sort ascending, select PlayerID for the second column. (or if you are using last and first name, put the PlayerID in the 3rd column). For bound column and column count, change the default from "1" to "2". ... Now when ever you use the PlayerID from from this table, Access will create a combo box for you! Note: You have to do this before you create your subform.
Back to the subform...
Tighten up the form as required and save the form. Open the main form, the session form in design mode - put this window in the back ground. Now click on the tblSessionProfile object in the form list, and drag the object into the main form. This will insert the subform into the main form. You will have to tidy up a bit - placement, sizing, etc.
One last step...
You need to link the subform and main form using the session ID. (Remember, the session ID is hidden on the subform, but it is still there) Bring up the properties for the subform. If the properties window is not open, right click on the subform and seelction properties. go to the data tab. Since you have already created your relationships, Access should depict the parent and child linkage using the SessionID field.
Now, when the Physiotherapist / IT guy needs to create a session, here will need to create the session and save it. (oh, oh, you will need a save button on the form), he can then enter the player info in the subform. Since this will use a combo box, the name will appear after typing a few letters of the player's name.
You are done!
But then you can always add a bit more...
Go at the data from the player to session. Create the main form using the player table. Create the subform using tblSessionProfile (or you can copy), but this time, make the player ID invisible and make the session ID visible.
Food for thought...
- Are you going to use one field for the player's name or have one field for the last name and a second for the first name (or vice versa)? If so, you will need to accomodate this in the lookup combo box and the subform. Note - You probably need two combo boxes - one for the last name, one for first name. You can "hide" a column by using the column width for a field set to zero.
- How are you going to reference the session? You have asession ID, but this may be less than friendly after the first 100 sessions or so... You can create a session number, or using the coach + date, etc.
You are smoking now!
Richard