dlookup

D

DD

i have a form in which i have a field i type in an item number. if the item
number exist i have another field that displays the description of the item
number using a dlookup from another table. after i type in the item number,
nothing seems to be displayed in the dlookup description box. if i come
back to that record, the desription is populated. why isnt it displayed as
soon as i type in the item number.

a second problem that is related to this form, i would like a msgbox to be
displayed if the item number isnt found in the table. i basically said if
the description is null after i type in item number, then display the
message box, "item not found". this isnt working. i wasnt sure if the
description box would be considered null if the dlookup doesnt find
anything. Is there some other arguement i could use.

thanks
 
A

Allen Browne

You can force the DLookup() to recalculate with:
Me.Recalc

Alternatively, you might be able to use a combo box, and bind the text box
to:
=[Combo1].[Column](1)
so it reads the value from the combo's 2nd column instead of doing a
DLookup().

The 2nd problem probably has to do with the timing. You might want to do a
DLookup() in code to see if the value is in the table. If it returns Null,
display your message.
 

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

dlookup form 1
Dlookup, one more time 2
How do I use dlookup in a form to find a specific field 1
form field 1
Error 424 in Auto Fill 3
Trying to use DLookup 3
Dlookup #error #name 4
Control Will Not Update 6

Top