0
votes

I have a lookup form, for a user to choose the record they want to edit. The lookup form opens, and has a combo box, and a list box. The combo box row source has an iif statement in the row source, which gives the list of contacts, and "if" no contact has been assigned to a record, there is a combo box value of " - Unassigned - ". The combo box, is to filter the row/source of the list box, much like the answer in this post instructs :

Filtering a Listbox based on Combobox selection

the list box will filter to the records that have been assigned to the contact chosen. I also need to set the list box row/source to filter to the records where no contact has been assigned, if the user picks the " - Unassigned - " option from the combo box. Does anyone know how we can do that? The way the process works, is that a record may not have an existing contact, until later in the process. Sometimes it is for an existing contact. I need to be able to filter and lookup records for existing and new contacts, so working through how to filter the listbox, based on a combo box selection, which is basically a break from the link of the id's in the bound columns of both the list box and the combo box, with the exception of the " - Unassigned - " option.

Any help would be greatly appreciated, as I peck around for a solution to this.

1
Sounds like will have to use VBA to set the RowSource property, along with the Requery line. I prefer to use the listbox GotFocus event. This handles situation of user going directly to the listbox when revisiting an existing record.June7
yeah, I ended up putting criteria in the row/source of the listbox, linking to the combo box control. I haven't gotten to testing it yet, so we'll see what happens when I do.missscripty

1 Answers

0
votes

The answer to this was to make the rowsource for the combo a union query, and then in the onchange have the listbox rowsource go off the Unassigned, All, or specific contact filter.