Display data in form based on dropdown list

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

Guest

I have a table or a query that i would like to control what is displayed on
the form by a dropdown list but am having a brain freeze on how to best to
accomplish that
 
Thank you for the link. As with most things now that know this I would like
to expand the functionality...

If the search return multiple records can I display them alltogether?
 
For that you can try another method:
********************************
You can use a Main Form that contain the combo, and Sub Form to list all the
records that match the selection.

In the RecordSource of the SubForm you can create a reference to the combo
in the main form

Select * From TableName Where FieldName = Forms![MainFormName]![ComboName]

***************************
If you want all the records to return if no value was selected in the combo,
then add another criteria to the RecordSource of the SubForm

Select * From TableName Where FieldName = Forms![MainFormName]![ComboName]
Or Forms![MainFormName]![ComboName] Is Null
***************************
On the AfterUpdate event of the combo run the code
Me.[SubFormControlName].Requery

To refresh the list of data in the SubForm
***************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top