Combo box to show records relating to a specific record

YNWA

Registered User.
Local time
Today, 06:31
Joined
Jun 2, 2009
Messages
905
Hi,

I have a combox field on subform C that shows records from a query.

How do I get this combo to only show records that relate to an ID on subform B.

I have a subform for storing contracts and these are stored against a company name.

On subform C I have a field that currently shows all records in a table. I need this combo to only show the records that relate the current record on subform B?

Anyone?
Thanks
 
What is the Form hierarchy? as in are both subforms in a main form or is subform c inside subform b which in turn is on the main form? Your ComboBox query (considering that subform b and c are two subforms on the main form) should read..
Code:
SELECT theFields FROM theTable 
WHERE theIDField = Forms!Mainform!SubformC.Form!ControlName
 
Thanks will give it a go.

The are 2 subforms on 2 tabs on a main form.

I just need ComboBox on Subform2 to only show records that relate to the ID of the record on Subform 1.

Thanks
 
What might help is to have the main form open in design mode, then use the query builder to create the record source for your combo box and use the wizard to set the criteria for the ID and navigate to:
Forms/Open forms/main form/sub form/ID field name
and that should give a reference string similar to what Pr2 has suggested above

David
 

Users who are viewing this thread

Back
Top Bottom