Dlookup not populating field

G

Guest

I am using the dlookup function to display handset type

=DLookUp("[Model]","Prefix List","[Prefix]=left([ReqIMEI],6) ")

This is supposed to display the Moldel from the prefix list table by
comparing the 1st 6 digits of the ReqIMEI with the 6 digit prefix.

This woks fine however only displays when the form is re-opened or when i
scroll through records. I would like to use it to dsplay the hanset type as
each ReqIMEI is entered in the form.
 
W

Wayne Morgan

Right off-hand, I wouldn't expect it to work at all unless you mistyped it
in your message. Try:

=DLookUp("[Model]","Prefix List","[Prefix]=" & Left([ReqIMEI],6))
or perhaps
=DLookUp("[Model]","Prefix List","[Prefix]=" & CLng(Left([ReqIMEI],6)))

even though you are after 6 digits, if the [Prefix] is a text field then

=DLookUp("[Model]","Prefix List","[Prefix]='" & Left([ReqIMEI],6) & "'")
 
G

Guest

the original dlookup worked only providing the results if the form was
refreshed

was not sure about the "&" - possably why this was not working

Workig now though many thanks :cool:


Wayne Morgan said:
Right off-hand, I wouldn't expect it to work at all unless you mistyped it
in your message. Try:

=DLookUp("[Model]","Prefix List","[Prefix]=" & Left([ReqIMEI],6))
or perhaps
=DLookUp("[Model]","Prefix List","[Prefix]=" & CLng(Left([ReqIMEI],6)))

even though you are after 6 digits, if the [Prefix] is a text field then

=DLookUp("[Model]","Prefix List","[Prefix]='" & Left([ReqIMEI],6) & "'")

--
Wayne Morgan
MS Access MVP


storm warden said:
I am using the dlookup function to display handset type

=DLookUp("[Model]","Prefix List","[Prefix]=left([ReqIMEI],6) ")

This is supposed to display the Moldel from the prefix list table by
comparing the 1st 6 digits of the ReqIMEI with the 6 digit prefix.

This woks fine however only displays when the form is re-opened or when i
scroll through records. I would like to use it to dsplay the hanset type
as
each ReqIMEI is entered in the form.
 

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