Referencing Text Boxes on forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a button on a form, when pressed it generates an event. Whe the event is triggered, I would like to use a variable, that the user enters into a text box on the same form, to query a database. How do I do I reference the text box?
If you have time it would be handy to have an example VB code that generates an SQL statement.
 
I have a button on a form, when pressed it generates an event. Whe the event is triggered, I would like to use a variable, that the user enters into a text box on the same form, to query a database. How do I do I reference the text box?
If you have time it would be handy to have an example VB code that generates an SQL statement.

In the query, as criteria, use the following syntax:

forms!NameOfForm!ControlName
 

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

Back
Top