1
votes

I am trying to find a solution on how to use combo boxes to find a record. The 3 fields in the circles are my primary key fields, as there is only one combination of Station/Product/Date.

I would love to have the form to switch to a certain record whenever one of those 3 fields is changed, witch all 3 values as criteria.Form Image

I've already tried to find solutions for this, but i only could find it for only one combo box. But i am not as advanced with Access and understanding of the code yet to just rewrite it for another solution.

Hope you guys can help me out.

Thank you

1

1 Answers

1
votes

I am assuming your top 3 boxes are unbound controls, and the other 3 are bound controls (see this question if you want to know the difference, to unbind a control just remove the control source).

If that is the case, you could just use something simple like this (fill in field and parameter names as needed): Set the Filter on load property of the form to Yes. Set the filter property to something like this:

MyField1 = [formControl1] AND MyField2 = [formControl2] AND myField3 = [formControl3]

Where MyField# are the field names in your table, and formControl# are the names of the fields you are filtering on.

Then make sure the form updates after changing the controls:

For each control:

Private Sub formControl1_AfterUpdate()
     Form.Requery
End Sub