Dlookup Help


F

FSUrules2883

I am using the following DLOOKUP string.

=DLookUp("TXTFIELD","Query3","Query3.CustomerNumber=" &
"[CustomerNumberFromReport]")

I am try to use the Dlookup to use a value that I get in the report
to lookup in a query and return me back some text. The problem that I
am encountering is it is selecting the first record in the query and
not based on the customer number.
 
Ad

Advertisements

J

J_Goddard via AccessMonster.com

Hi -

How are you using this expression? Is it a report Controlsource? If so, what
section of the report is it in, and what section of the report is
[CustomerNumberFromReport] in?

John


I am using the following DLOOKUP string.

=DLookUp("TXTFIELD","Query3","Query3.CustomerNumber=" &
"[CustomerNumberFromReport]")

I am try to use the Dlookup to use a value that I get in the report
to lookup in a query and return me back some text. The problem that I
am encountering is it is selecting the first record in the query and
not based on the customer number.
 
D

Duane Hookom

Assuming CustomerNumber is really a number, try:

=DLookUp("TXTFIELD","Query3","CustomerNumber=" & [CustomerNumberFromReport])

I would look for a way to include Query3 in your reports recordsource so you
could add TXTFIELD to the report's record source.
 
J

John Spencer

Assumption:
Customer Number is a text field
DLookUp("TXTFIELD","Query3","CustomerNumber=""" &
[CustomerNumberFromReport] & """")

If CustomerNumber is actually a number field then
DLookUp("TXTFIELD","Query3","CustomerNumber=" &
[CustomerNumberFromReport])

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
F

FSUrules2883

it is in the detail section of the report and the customer number is a
text field
 
Ad

Advertisements

F

fredg

I am using the following DLOOKUP string.

=DLookUp("TXTFIELD","Query3","Query3.CustomerNumber=" &
"[CustomerNumberFromReport]")

I am try to use the Dlookup to use a value that I get in the report
to lookup in a query and return me back some text. The problem that I
am encountering is it is selecting the first record in the query and
not based on the customer number.

You posted this same question yesterday morning and have received the
same replies you have in this thread.
If you don't understand the replies, or you have trouble implementing
it, rather than re-post the same question, stay within the thread and
tell us what you don't understand or what result you get that is
incorrect.
By asking the same question here you have only wasted other peoples
time and effort and since the replies are the same as in the previous
thread, you are no further along than you were before.
 
Ad

Advertisements


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

Top