Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I feed the field I want to query on from a form?

Status
Not open for further replies.

NameWithheld

Technical User
Jun 23, 2003
2
US
I am a bit rusty at this.
I have a form with 2 pick lists. cbo1 selects from a list of fields in the table and is bound to a field that contains the actual names (i.e. [city] or [state] or [zip] etc.), cbo2 gives the choices for that field (fed by entries in the underlying table)
I want to run a report that is filtered essentially where cbo1=cbo2. And I can't figure out how to do it.
I don't really care whether the solution is SQL or VBA.

Does anybody have any ideas?

Thanks,
 
to get records where cbo1 = cbo2 try this...

create a new query
in query design view, select all the fields you want to see on the report
in the criteria section of the cbo1 field enter this:

=[cbo2]

this should pull all records where cbo1 = cbo2.

now, create your report and make its record source the query you just created.


hope this helps you.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top