Filtering query for Combobox in Subform

jazztie

Registered User.
Local time
Today, 21:57
Joined
Jun 9, 2005
Messages
19
I have this form where there's mention of CompanyID

In a subform, I have the information about all the contacts of this Company. In order to see full detail information for a particular contact (of that particular Company) I have a Combobox with a query.

At least: that's the whole idea. Unfortunately it doesn't work in Access:
SELECT Contact.ContactID, Contact.Name
FROM Contact
WHERE ((Contact.CompanyID)=(Me!frmCompany![ContactID]));


Can any help me? I need to do more of the sorts of queries... and I can't figure it out how to use values from forms and parent-forms.

Any help is appreciated,

Jazz
 
Not knowing how your form is designed

I would make two combo boxes, The first picking the company, the second picking the contact.

First ComboBox name it cboSelectCompany. Query controls could be "CompanyID"; "CompanyName".

Second ComboBox name it cboSelectContact. Query controls could be "ContactID"; "ContactName"; "CompanyID".

Criteria for "CompanyID" should be =Forms![YourFormsName].[cboCompanyID]
this criteria will link the two comboboxes.

From the first one you'll pick the Company
From the second you'll pick the Contact

Let me know if you need more help
 
Last edited:

Users who are viewing this thread

Back
Top Bottom