Help with DLookup in a Report

V

Veli Izzet

Hi all,

I want to get the date of an invoice from a table to a report.

The table, tblFT has three fields,

FtID, FtDate, and FTNo


=DLookUp("FtDate";"tblFT";"FtNo=Numara") gives error on the report.

The report gets "Numara" as a parameter. Numara is numeric and is
something like 32455, 32456, etc.

For troubleshooting,
=DLookUp("FtDate";"tblFT";"FtNo=32455"),
=DLookUp("FtDate";"tblFT";"FtNo=32456"), etc. did not work too.

but
=DLookUp("FtDate";"tblFT";"FtID=1"), etc worked.


I tried FTNo as a text field, and as number field, the error remains.


Any help?

Thanks..
 
S

Steve Schapel

Veli,

Is the name of the field in the tblFT table FtID or FtNo?

It looks like you are using this expression in the Control Source of a
textbox on the report, am I right? What is 'Numara'? You said "The
report gets 'Numara' as a parameter", but I don't understand what this
means. Do you mean that the report is based on a Parmater Query, and you
are prompted for the entry of this value when the report is printed, so
therefore Numara is actually the name of a field in the query?
 
V

Veli Izzet

Steve,

FtID is the ID is a an autonumber field, FtNo is just the number of the
Invoice, can be numeric or text, it does not matter.

"Numara" is the parameter value which is passed to the query, is not a
field.

The user is prompted with an input box which says "Numara" on it, It
could just as well be "Please enter the Invoice number:".

I just want to get the invoice date from the tblFT for the invoice
number "Numara", and print both the Invoice number, and Invoice date on
the Invoice.

This is kind of an awkward procedure, but one of the big companies we
are working with has somewhat different procedures, and we must comply
with them.

We get consignment orders, deliver at different times, and invoice
partially from different orders, different delieveries, etc.
 
S

Steve Schapel

Veli,

Ok, thanks for the further explanation. Try it like this...
=DLookUp("[FtDate]";"tblFT";"[FtNo]=" & [Numara])

The other way to do it, probably simpler and more efficient, would be to
include the tblFT table in the query that the report is based on, in
which case you would have direct access to the required [ftDate] value.
 

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

Similar Threads

#Error from dlookup 2
DLookup to bring report totals into form controls 3
Problem with Dlookup with 2 criteria 1
Dlookup error 13 7
DLookUp Function 11
Dlookup 4
DLookup can't find a value 13
dlookup 2

Top