Filtering a Query using a form..

richardcasci

Registered User.
Local time
Today, 12:08
Joined
Mar 23, 2012
Messages
16
I searched for the answer to this but was unable to find a solution that I understand.

I am terrible at coding but I am good at copying code to fit my database.

I currently have this form (combobox) that filters using one piece of criteria.

Private Sub cboSelectPress_AfterUpdate()
'Moves to Press field and
'finds records where "press" matches whatever is selected in the combo box
DoCmd.ShowAllRecords
Me!Press.SetFocus
DoCmd.FindRecord Me!cboSelectPress

End Sub

"Press" is a machine number. How can I add more combo boxes to filter additional information from my query. Like "room" or "product" or "date?" What happens if the user leaves one of the boxes blank?

My fields are

"Date"- date the product was ran
"press"- the press it was ran on
"product"- the name of the product
"shift"- the shift it was ran on

I want the user to be able to select ALL or none of these fields for results. Any help would be greatly appreciated.

I am using Access 2013
 
Last edited:
Upload the table (Access 2003) with some data for tests and I'll give you something to copy and to adapt :)
 
I uploaded as an excel file. The first three tabs are examples of tables... The last tab is the Query. I want a form that can sort by any one of those first fields. Just one field, or all the fields that correspond with the tables.


Does this help?
 

Attachments

Users who are viewing this thread

Back
Top Bottom