Dlookup problem with date..

M

Mikael Lindqvist

Hi,

The field SL03004 is type "date/time" and SL03002 is type "text", both
located in table SL03L000

Faktnr1 is the name of the combobox (that in itself is a result - DLookup -
from another textbox).

Now, below code (in control source) just gives me an error...

=DLookup("SL03004";"SL03L000";"SL03002 = '" &
[Forms]![kund_f_faktkomm]![Faktnr1] & "'")

Any ideas?

Kindly,
Mikael
Sweden
 
J

Jeanette Cunningham

Mikael,
try this, with square brackets around the field name SL03004
=DLookup("[SL03004]";"SL03L000";"SL03002 = '" &
[Forms]![kund_f_faktkomm]![Faktnr1] & "'")

you can also insert this line just above the DLookup line to see if the form
can find the value for [Forms]![kund_f_faktkomm]![Faktnr1]
Debug.Print "faktnr1: " & [Forms]![kund_f_faktkomm]![Faktnr1]
run the form then press Ctl + G to open the immediate window
you will see if the form could correctly find the value of
[Forms]![kund_f_faktkomm]![Faktnr1]

Is kund_f_faktkomm a separate form that is open at the same time as the
form with the DLookup code?

Jeanette Cunningham
 

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