Form Object as Query Criteria

J

Jeff Bendert

Access XP, Windows XP

I have a select query. In the criteria field, I want to use whatever is
selected in an unbound combo box on a form. The name of the form is
frmSenateReports. The name of the Combo Box is Combo37.

In the criteria field of the query I have entered the following:

[Forms]![frmSenateReports]![Combo37]

When I open the Senate Reports form and select a Senate District from the
Combo Box and click on the Preview Report button (This button runs a report
that is based on the select query), it displays "Error."

Any thoughts on what I am doing wrong??

Thanks for your help,

Jeff
 
J

Jackie L

First, you should have a name for your field that represents what it is. It
makes the programming more logical.

Anyway, can your query run independent of the report? Just trying to find
out if the error is in the report or the query. Look to make sure your data
types are the same between your unbound field and the field in the query. If
the query can run on its own, then perhaps your field on the report is not
based off a valid record source.
 
Top