2 Forms, 1 Table How Do I Link???

andy_dyer

Registered User.
Local time
Today, 21:49
Joined
Jul 2, 2003
Messages
806
Hi,

I want to have a sub form running off the back of a main form.

They are both running off the same table they just show different fields.

I want ID, name & surname to be shown on both (which i have)

I want to be able to get it so that when i am viewing record 5 alan jones, on my main form when i click my command button to view the sub form I just see his details and not everyone's??

Thanks

Andy
 
Have you linked the child and master fields in the subform's properties with the ID number?
 
Nope!

How do I do that?

Thanks

Andy
 
In design view, click on your subform, look at the properties box, and you should see 'link child fields' and 'link master fields'. You'll see a little box with three dots in it (ellipsis?), click on it and a box will come up where you can choose which fields you want to link - your ID number. HTH.
 
It does not make sense to have a form and subform based on the same table. Why would you need a subform? There are not multiple rows to show.
 
There were just too many fields to display on one form, and it was looking a little messy so i thought I would strip some out and place them on a seperate form but linked up!

Thanks Tay by the way, it is now working a treat!!

Andy
 
Just to chip in my few pennies worth :)

I use the tab control when I have a form based on one table that has too many fields to display on the screen. Using this means I can group my controls in a logical order in each page of the tab control.

Generally speaking subforms are used when you want to display/edit/add data from 2 or more tables. For example, I have 2 tables: tblOrders and tblOrderDetails and both are linked on OrderID and the relationship is one to many. Following on from Pat's comments this means I have one row from tblOrders and many rows from tblOrderDetails. Therefore I have a form with a subform where the master and child fields are linked on OrderID.

HTH
Rob
 

Users who are viewing this thread

Back
Top Bottom