Simple Access Query

  • Thread starter Thread starter Samuel
  • Start date Start date
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
 
Realistically, you don't need to call a query. Using the DLookup function
should be sufficient to return the required value from the query.
 
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.
 
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'")
 
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'")
 

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