Combo Box Search

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a separate lookup table (contact name) that I want to use as selection
values for a combo box search. When a name is selected, a new form would
reveal all records from the master table that contain the contact name value
that was selected in the combo box. I have been able to create the combo box
with the lookup table values but I have not been able to link it so that I
can retrieve all the records with matching name criteria. I'm sure it's easy
but I can't figure it out. Thanks in advance.
 
If I were building this, I'd:

* create a report that returns all the records.
* create a form based on that query.
* add an unbound combobox in the header of that form.
* modify the query to use the contents of the form's combobox as a
selection criterion (i.e., only return the record<s> that match the selected
combobox value)
* add the following to the AfterUpdate event of the combobox:

Me.Requery

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Thank you, Jeff. I've done what you suggested but I am not sure how to
modify the query so that it uses the contents of the form's combobox as
selection criteria. Sorry, I'm fairly new to Access. Thank you for your
help!
 
You can use the wizard in the query design view, or you can type in
something like:

Forms!YourFormName!YourControlName

in the Selection Criterion "cell" under that field.

NOTE: if your form isn't opened when you run the query, Access has nothing
to look at as a criterion.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
That worked. Thanks.

Jeff Boyce said:
You can use the wizard in the query design view, or you can type in
something like:

Forms!YourFormName!YourControlName

in the Selection Criterion "cell" under that field.

NOTE: if your form isn't opened when you run the query, Access has nothing
to look at as a criterion.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Back
Top