Combo Box Selection

M

MimiSD

In my form I would like to have a combo box that when the user makes a
selection the records that correspond with that selection will be displayed.
I have tried adding a combo box and choosing the "Find a record on my form
based on the value I selected in my combo box." This appears to only pull up
the first record that corresponds with the selection not all records.
Another problem with this way is that the combo box only holds the values of
records that are already created. I want it to show all options and if there
is not a record corresponding to display an error message. I hope this makes
sense. I know i kind of jumped around a lot.
My tables that I am using are:

tblIssues:
IssueID-autonumber
Descriptor-Look-up list of general descriptions pulled from another table of
possible answers

tblSchool: (sub-form)
SchoolCode- PK

The combo box that i want the user to choose from is the descriptor. I want
all issues with that general descriptor to show.
 
B

Brian

Think of this as a filtering process rather than a selection process.
Assuming a bound form, try this:

In the record source of the form, include [Forms]![ThisForm]![FilterField]
as the parameter for the descriptor field where ThisForm is your form's name
and FilterField is the name of the combo box. Then, in the combo box's
AfterUpdate event, do a Me.Requery, which will requery the form to show only
those records where the descriptor field is equal to the current contents of
the combo box.
 
M

MimiSD

I tried this but it comes back with an error saying "The record source,
[Forms]![Unresolved Form]![cboDescriptor] specified on this form or report
does not exist. What am I doing wrong?

Brian said:
Think of this as a filtering process rather than a selection process.
Assuming a bound form, try this:

In the record source of the form, include [Forms]![ThisForm]![FilterField]
as the parameter for the descriptor field where ThisForm is your form's name
and FilterField is the name of the combo box. Then, in the combo box's
AfterUpdate event, do a Me.Requery, which will requery the form to show only
those records where the descriptor field is equal to the current contents of
the combo box.

MimiSD said:
In my form I would like to have a combo box that when the user makes a
selection the records that correspond with that selection will be displayed.
I have tried adding a combo box and choosing the "Find a record on my form
based on the value I selected in my combo box." This appears to only pull up
the first record that corresponds with the selection not all records.
Another problem with this way is that the combo box only holds the values of
records that are already created. I want it to show all options and if there
is not a record corresponding to display an error message. I hope this makes
sense. I know i kind of jumped around a lot.
My tables that I am using are:

tblIssues:
IssueID-autonumber
Descriptor-Look-up list of general descriptions pulled from another table of
possible answers

tblSchool: (sub-form)
SchoolCode- PK

The combo box that i want the user to choose from is the descriptor. I want
all issues with that general descriptor to show.
 

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

Top