Combo Box not working

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

Guest

I have created an unbound form with 1 Combo Box named cboResource (in view of
having users select their name to filter a query. When I open this form the
combo box is displayed properly (has a drop down and shows all the names of
my resources)

On the Criteria line In my query, under resource name, I entered the
following code:

[Forms]![frmResource]![cboResource]

When I run the query, I don't get a combo box, I get the "Enter parameter
value" with one line (no drop down).

Any ideas?
 
Hi

Is the form open when you open the query?. If not then the query is looking
for the the perameter that you have set [Forms]![frmResource]![cboResource]

You could set the query to run AfterUpdate of the cboResource combo

Private Sub cboResource_AfterUpdate()
DoCmd.OpenQuery "QueryName", acViewNormal, acEdit
End Sub


Another answer would be to create a small popup with just the combo on it
and use the AfterUpdate as above and add the close form function code


Hope this helps
 
You won't get a dropdown for a parameter.
[Forms]![frmResource]![cboResource] refers to the current value of the
combobox, not the combobox and its contents.
 
If the form isn't open, the query can't "see" what's in the form's combo
box.

If you are trying to get the query to OPEN the form and combo box, back up!

First open the form, select the combo box value, then run the query.

If you are still getting the parameter prompt, there's a spelling error
somewhere...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
My ultimate goal is this:

I have a form linked to a query. From a menu option I would like my users
to select their name, which would open the form, and have access to their
record set (as filtered by the query)

Jeff Boyce said:
If the form isn't open, the query can't "see" what's in the form's combo
box.

If you are trying to get the query to OPEN the form and combo box, back up!

First open the form, select the combo box value, then run the query.

If you are still getting the parameter prompt, there's a spelling error
somewhere...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Jet said:
I have created an unbound form with 1 Combo Box named cboResource (in view
of
having users select their name to filter a query. When I open this form
the
combo box is displayed properly (has a drop down and shows all the names
of
my resources)

On the Criteria line In my query, under resource name, I entered the
following code:

[Forms]![frmResource]![cboResource]

When I run the query, I don't get a combo box, I get the "Enter parameter
value" with one line (no drop down).

Any ideas?
 
Back
Top