Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering using data contained in two combo boxes

Status
Not open for further replies.

Gerimc

Programmer
Jul 22, 2003
19
GB
I have a form which contains accounting data for different companies and for each year. I want to be able to filter by a year and then by the company and all the data for that particular selection will appear on the form in text boxes. How would I go about doing this? I have my combo boxes linked by but they don't filter anything.
 
create a query to use as the Recordsource for your Form. Set the criteria row for the two fields picked by ComboBoxes to

Forms!YourFormName!TheComboBoxName



PaulF
 
When I do as you say here my form goes blank and I can't select form the combo boxes
 
Place the ComboBoxes in the Form Header not in the Detail section

PaulF

 
My Combo boxes are in the form header area and my text boxes are in the detail section
 
You might be get some idea from this FAQ faq702-3924


Hope this helps... :)
Hasu
(Trust on someone, someone will trust you!)
 
Your Query SQL should look something like this

Select * from YourTableName Where Company = '" & Forms!YourFormName!YourComboBoxNameToSelectCompany & "' AND Year(YourYearField) = " & Forms!YourFormName!YourComboBoxNameToSelectCompany


PaulF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top