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

Set a variable equal to a query result 1

Status
Not open for further replies.

kramerpup

Technical User
Mar 2, 2001
25
US
How do I set the results of a query equal to a variable?

I am simply trying to update one text box on a form based on what a user types in another unbound text box. The user presses a button, and Access populates the second text box based on a query that uses the input just given.

I know this must be simple, but I've hit a wall. Can someone help?

Thanks
 
Hi,
You can use this function where:

expr: A string expression that identifies the field whose value you want to return.
domain: A string expression identifying the set of records that constitutes the domain. It can be a table name or a query name.
criteria: An optional string expression used to restrict the range of data on which the DLookup function is performed.

Syntax:
DLookup(expr, domain[, criteria])

Have a good one!
BK
 
Thanks for the tip!

I don't know all my VBA functions yet, but I knew this would be faster than wading through Access's help (which incidentally I'd already done for half a day!).

Kpup
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top