two tables into a form

  • Thread starter Thread starter LTOSH
  • Start date Start date
L

LTOSH

I have two tables...
Table 1 = tblClient
cClientID AutoNumber PK
cFirstName
cLastName
(+ plus pther dempgraphic info)

Table 2 = tblClientWorkout
cwClientWorkoutID AutoNumber PK
cw_cClientID
(plus other info)

I have a form based on the tblClient with a command button that is labeled
"Create Workout" that I want to open a form based on the tblClientWorkout. I
want the frm_tblClientWorkout to be connected to that particular clients
name. How do I do this? On the frm_tblClientWork i want the name of the
client at the top(header) of the form. Then the information on body I will
have multiple exercises but all associated with that same client. then I
will create a report from that form to print.

I hope I make sense...I am close but can't seem to get my client name to be
associated with this form.

Thanks!
 
I have two tables...
Table 1 = tblClient
cClientID AutoNumber PK
cFirstName
cLastName
(+ plus pther dempgraphic info)

Table 2 = tblClientWorkout
cwClientWorkoutID AutoNumber PK
cw_cClientID
(plus other info)

I have a form based on the tblClient with a command button that is labeled
"Create Workout" that I want to open a form based on the tblClientWorkout. I
want the frm_tblClientWorkout to be connected to that particular clients
name. How do I do this? On the frm_tblClientWork i want the name of the
client at the top(header) of the form. Then the information on body I will
have multiple exercises but all associated with that same client. then I
will create a report from that form to print.

I hope I make sense...I am close but can't seem to get my client name to be
associated with this form.

Don't associate the *NAME*. Associate the ClientID instead.

Use a Form based on tblClient, with a Subform based on tblClientWorkOut. Use
cClientID as the Master Link Field and cw_cClientID (which I presume is a Long
INteger foreign key linked to cClientID) as the Child Link Field. The "header"
you describe would be the form itself; the "body" would be the subform.

Your Report would not be based on the form, but on a query joining the two
tables. You could use the report's Sorting and Grouping feature to display
client information in a group header (grouping by client ID and/or client
name) and the workout information in the report's Detail section.
 
Back
Top