two tables into a form

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!
 
J

John W. Vinson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top