views:

78

answers:

1

I have two tables: Person and Shift

Person has as lookup field which is a one to many relationship with Shift.

I would like to create a form in which a listbox displaying records from Person is filtered based on the selection of a combobox containing the records from Shift.

in other words, i want to select "days" (value 1) in the combobox, and have only the records from Person that have value 1 in their Shift field displayed in the listbox?

the equivalent sql would be something like:

SELECT * FROM Person WHERE Person.Shift = (the value of the combobox here)

Also, if possible, i would like to do this with little to no VBA as the person i'm passing this off to has no VBA experience and can't be expected to fix bugs in the VBA code.

+1  A: 

All you have to do is use the query builder in access and set the criteria to the value of the first combo box

[Forms]![frmMy_form]![cboFirst_combo_box]

Then in the after update event of the first combo box just put

Me.Second_combo_box.Requery
Kevin Ross
@wtfsven You can can access the builder by clicking the three dots to the right of the Record Source on the property sheet for the listbox.
Remou
AH! It was the call to Requery I was missing! Thanks alot!
wtfsven