Parameter query for a combo box row source

J

JimP

A query for a combo box on a form uses a value from a text box on the same
form. Can I refer to the text box without specifying the form name? e.g.

Currently I am using "Forms!Form1!Text1" - would like to use something like
"Forms!(Me.Name)!Text1"
 
A

Allen Browne

No. If you use the criteria in the form, it must include the form name to
find the text box.

It might be possible to write a VBA function that returns the value of the
active text box on the active form, and then use the function in the
criteria of your query.

Alternatively, it might be better to avoid putting the criteria in the query
at all. Use the Filter of the form, or the WhereCondition of OpenReport.
 

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