How to use Text box content in a form query?

K

keithb

I have a form based on a query where each record is displayed on one row.
This form contains an unbound textbox that I want to use to select which
records get displayed in the form. I have tried using
[forms]![formname]![textboxname]![Text] in the Query WHERE clause, but that
does not work.

Can someone tell me how to pass the content of the unbound text box in a
form to the query used as a data source for that form?

Thanks,

Keith
 
F

fredg

I have a form based on a query where each record is displayed on one row.
This form contains an unbound textbox that I want to use to select which
records get displayed in the form. I have tried using
[forms]![formname]![textboxname]![Text] in the Query WHERE clause, but that
does not work.

Can someone tell me how to pass the content of the unbound text box in a
form to the query used as a data source for that form?

Thanks,

Keith

In Access it is the control's Value property you need to use, not it's
Text property. Since the Value property is the Default, you do not
need to explicitly write it:

[forms]![formname]![textboxname]

The form must be open when the query is run.

If you still have a problem, it would be in your interest to copy and
paste into your reply the exact query SQL.
 

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