Okay - do I need a subform??? (Probably really easy!)

edrussell

New member
Local time
Today, 22:20
Joined
Dec 28, 2006
Messages
1
Here's the situation... (i'm new btw! ;) )

I have a form that is bound to a table. On it I put a list box which gets it's data from a seperate table which has a link to my form table. I need to filter the results in the list box to those that are applicable to the record selected by the main form...

It gets complicated as I have a number of these list boxes on various tables - do I need many sub forms or is there a better way of building the WHERE clause to pick up the Id value in the master (form) table???

Cheers,

Ed.
 
Hello:

I looks as if you need to related all your tables with a "Primary to Foreign" key relationship to pull this off.

What you have right now is called a "Look-up" table arrangement.

Regards
Mark
 
In addition to Foreign Keys....

In addition to setting up a foreign key in tables that are related to the main table (i.e. Customer table [CustomerID] as a primary key becomes the foreign key in the sales table where the [SalesID] is the primary key and the [CustomerID] is the key related back to the main table), you can use the Tab control in the toolbox in Access 2000 or later to place each related table under a different Tab. Be sure that your subform's underlying table/query FIELD list includes the [CustomerID] field even if you don't use it or display it on the subform. Entries made in the subform will pull the [CustomerID] of the current Customer which is displayed in the Main Form.

Hope that helps
 

Users who are viewing this thread

Back
Top Bottom