A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

two tables into a form



 
 
Thread Tools Display Modes
  #1  
Old June 8th, 2009, 03:24 AM posted to microsoft.public.access.tablesdbdesign
LTOSH
external usenet poster
 
Posts: 63
Default two tables into a form

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!
  #2  
Old June 8th, 2009, 03:55 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default two tables into a form

On Sun, 7 Jun 2009 19:24:01 -0700, LTOSH
wrote:

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.
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:14 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.