storing vairables from query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query that has some fields that I want to store. The first is
'developername'. I created a vairable named 'xdevelopername' and use the
dlookup command. The example in help is as follows:

varX = DLookup("[LastName]", "Employees", "[EmployeeID] = 1")

The instructions name 3 arguments, expr, domain, criteria, with criteria
being optional. Can anyone tell me why this is incorrect? The query result
is one record so I'm thinking that:

xDeveloperName = DLookup("[DeveloperName]", "qryBill")

xdevelopername is = to the DeveloperName in the query 'Bill"

Thanks
Mr. Dumb
 
A similar DLookup works for me in the Immediate Window. If I base it on the
entire Table not on a Query, it returns the specified Field from the first
Record of the Table.

What error message are you getting?

What is happening and what did you expect to happen?

Larry Linson
Microsoft Access MVP
 
Hi Larry. I don't get any error message, I just don't get the Developer's
Name. The MsgBox says the Developer's Name is 127, even as I see what the
result should be from the query. I use the query because there is
information I want to store from 4 tables, so I built the query to retrieve
the info. Is that incorrect?

Larry Linson said:
A similar DLookup works for me in the Immediate Window. If I base it on the
entire Table not on a Query, it returns the specified Field from the first
Record of the Table.

What error message are you getting?

What is happening and what did you expect to happen?

Larry Linson
Microsoft Access MVP


williamr said:
I have a query that has some fields that I want to store. The first is
'developername'. I created a vairable named 'xdevelopername' and use the
dlookup command. The example in help is as follows:

varX = DLookup("[LastName]", "Employees", "[EmployeeID] = 1")

The instructions name 3 arguments, expr, domain, criteria, with criteria
being optional. Can anyone tell me why this is incorrect? The query
result
is one record so I'm thinking that:

xDeveloperName = DLookup("[DeveloperName]", "qryBill")

xdevelopername is = to the DeveloperName in the query 'Bill"

Thanks
Mr. Dumb
 

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