Using multiple combo boxes to filter a subform

puakenikeni

Registered User.
Local time
Today, 02:00
Joined
Jun 24, 2008
Messages
25
I have a form (frmInventory) and it's subform (frmInventorySub) in my database. I have three combo boxes on frmInventory, and I want to use the three combo boxes (cboProgramName, cboItemClass, cboPropertyClass) to filter information from the main table (tblInventory). The subform is basically a query of the main table.

The three combo boxes are set up to get its values from three other tables in the database. I set the child/master fields so that the combo box matches the field in the subform. However, when I change the values of the combo boxes, it only seems to try to "add" another record to tblInventory, instead of displaying the information that should be in the main table.

Do I need to set up something in the query to display the information? For instance, do I need to set up the criteria in the query? Would putting in a WHERE clause in the query help to display the correct information?

I also have this in my AfterUpdate method:

Code:
Me.Repaint
Me.cboItemClass_tab2.Requery
Me.cboPropertyClass_tab2.Requery
Me.subMaster.Requery
However, it doesn't automatically refresh the subform. Or maybe it is, but I'm doing it incorrectly. How do I get the subform to automatically update itself if any of the three combo boxes change?

Thanks in advance!
 

Users who are viewing this thread

Back
Top Bottom