Simple Access Query

S

Samuel

Hi

I would like to allow the user to click on a button and then call a query
and assign the returned value to a textBox control

How can I do that?

Thank you,
Samuel
 
D

Douglas J. Steele

Realistically, you don't need to call a query. Using the DLookup function
should be sufficient to return the required value from the query.
 
S

Samuel

Any samples please?


Douglas J. Steele said:
Realistically, you don't need to call a query. Using the DLookup function
should be sufficient to return the required value from the query.
 
D

Douglas J. Steele

DLookup("NameOfField", "NameOfQuery")

That assumes that the query only returns a single row. If it returns
multiple rows, you'll need to provide the 3rd argument, which is a Where
condition without the word "WHERE" in it:

DLookup("NameOfField", "NameOfQuery", "Field1 = 1 And Field2 = 'Help'")
 
S

Samuel

Thank you

Samuel

Douglas J. Steele said:
DLookup("NameOfField", "NameOfQuery")

That assumes that the query only returns a single row. If it returns
multiple rows, you'll need to provide the 3rd argument, which is a Where
condition without the word "WHERE" in it:

DLookup("NameOfField", "NameOfQuery", "Field1 = 1 And Field2 = 'Help'")
 
Top