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!

Using data typed by the user

Status
Not open for further replies.

millzy7

Programmer
Dec 9, 2003
96
US
Hi, in a query i ask the user for a name ie [Please enter name]

But later in the code i want to use this value. Does Access store this in a variable that can be accessed?

So my question is, Can i read this value from my VBA code?

Thanks

Millzy
 
Not exactly. 2 thoughts, Look at the field that you ask for the name. If you are using it in a where clause or as an expression in a field then you should be able to reference that field in code.


Otherwise construct your sql statement in code storing the input in a variable. Then assign the sql statement the query. Then you can use the query and have the input data stored in a variable.

There are plenty of examples in these forums on how to change the SQL of an existing query.



Andy Baldwin

"Testing is the most overlooked programming language on the books!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top