Query by form with Combo box

J

Justin Busch

I am attempting to use a value supplied by a combo box in a query using
Access 2003. The values in the combo box are supplied by a "Select distinct
values" query.

The combo box is set to have its Row Source to the "distinctDates" query

The query that needs the value from the combo box has
Field: date
Table: master
criteria: [Forms]![form1]![combo1]![value]

I have set the event procedure for After Update to:
DoCmd.OpenQuery "queryByDate", acViewNormal, acEdit

However, once I choose a value from the combo box I receive an empty query
result. Am I missing a crucial step somewhere or am I going about this the
wrong way?

Any help would be appreciated.

Justin Busch
(e-mail address removed)
 
G

Guest

Hi, Justin.

"value" is not an object of your combo box control, it is a property. The
bang operator (!) delimits a parent object from a specific object in its
collection. Change the query criteria to:

[Forms]![form1]![combo1].value

or, more economically, since value is the default property of a form control:

[Forms]![form1]![combo1]

Hope that helps.
Sprinks
 
J

Justin Busch

Well I'll be, Sprinks!

Thanks very much, that's exactly what I needed.

Justin


Sprinks said:
Hi, Justin.

"value" is not an object of your combo box control, it is a property. The
bang operator (!) delimits a parent object from a specific object in its
collection. Change the query criteria to:

[Forms]![form1]![combo1].value

or, more economically, since value is the default property of a form control:

[Forms]![form1]![combo1]

Hope that helps.
Sprinks


Justin Busch said:
I am attempting to use a value supplied by a combo box in a query using
Access 2003. The values in the combo box are supplied by a "Select distinct
values" query.

The combo box is set to have its Row Source to the "distinctDates" query

The query that needs the value from the combo box has
Field: date
Table: master
criteria: [Forms]![form1]![combo1]![value]

I have set the event procedure for After Update to:
DoCmd.OpenQuery "queryByDate", acViewNormal, acEdit

However, once I choose a value from the combo box I receive an empty query
result. Am I missing a crucial step somewhere or am I going about this the
wrong way?

Any help would be appreciated.

Justin Busch
(e-mail address removed)
 

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

Similar Threads

Trouble with combo box 1
Combo box trouble 1
Combo box trouble 1
combo box data type 1
Combo box item selesction 3
Combo Box Question 4
Combo Box Requering 2
Combo Box QUESTION 5

Top