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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Criteria

Status
Not open for further replies.

mtanney

Programmer
Mar 6, 2003
11
EU
How can I set the query criteria to a value from an input box?
 
I am assuming you truly mean InputBox command here rather than text box.

Create a global variable and a function in a database module:
Global vInputBoxData as Variant
Function InputBoxData()
InputBoxData = vInputBoxData
End Function

Then in your code use this:
vInputBoxData = InputBox("Please enter criteria")
DoCmd.OpenQuery "qryYourQueryName"

The criteria row for the column/field in your query should look like this as you are making a Function Call:
InputBoxData()

This should do it for you.

Bob Scriver
Want the best answers? See FAQ181-2886
Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top