DLookup function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Could someone please shed some light and assist with the config on this one?

Here is the code I use,
=DLookUp("[NAME]","[BRAGG]","[SSN] = Forms![NAME]")

I want to scan a SSN using a Bar Code Scanner into the form called IAG, I
want to populate the name from a bragg table into the IAG Form.

It will not populate as of yet.

Thanks,
Lee
 
lmossolle said:
Could someone please shed some light and assist with the config on this one?

Here is the code I use,
=DLookUp("[NAME]","[BRAGG]","[SSN] = Forms![NAME]")

I want to scan a SSN using a Bar Code Scanner into the form called IAG, I
want to populate the name from a bragg table into the IAG Form.

It will not populate as of yet.

Your final argument points at a form, but not at a specific control on that
form. It should be...

Forms!NameOfForm!NameOfControl

If this is the same form that you are using the DLookup() in then an alternative
syntax is...

=DLookUp("[NAME]","[BRAGG]","[SSN] = '" & Me![NAME] & "'")

By the way you should not have an field or control named "NAME" as that is a
reserved word. Change to EmployeeName, UserName, or similar.
 
Does this need to go on the Name Field? When I put a SSN in the name does not
populate

Thanks!!!

Allen Browne said:
Concatenate the value from the form into the 3rd string, like this:
=DLookUp("[NAME]","[BRAGG]","[SSN] = """ & Forms![Form1]![NAME] & """")

For an explanation of the quotes, see:
Quotation marks within quotes
at:
http://allenbrowne.com/casu-17.html

Hopefully you don't really have a field named "Name".
Will cause all sorts of problems.
There's a list of names to avoid here:
http://allenbrowne.com/AppIssueBadWord.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

lmossolle said:
Could someone please shed some light and assist with the config on this
one?

Here is the code I use,
=DLookUp("[NAME]","[BRAGG]","[SSN] = Forms![NAME]")

I want to scan a SSN using a Bar Code Scanner into the form called IAG, I
want to populate the name from a bragg table into the IAG Form.

It will not populate as of yet.

Thanks,
Lee
 
Yes. Replace Form1 with the name of your form.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

lmossolle said:
Does this need to go on the Name Field? When I put a SSN in the name does
not
populate

Thanks!!!

Allen Browne said:
Concatenate the value from the form into the 3rd string, like this:
=DLookUp("[NAME]","[BRAGG]","[SSN] = """ & Forms![Form1]![NAME] &
"""")

For an explanation of the quotes, see:
Quotation marks within quotes
at:
http://allenbrowne.com/casu-17.html

Hopefully you don't really have a field named "Name".
Will cause all sorts of problems.
There's a list of names to avoid here:
http://allenbrowne.com/AppIssueBadWord.html

lmossolle said:
Could someone please shed some light and assist with the config on this
one?

Here is the code I use,
=DLookUp("[NAME]","[BRAGG]","[SSN] = Forms![NAME]")

I want to scan a SSN using a Bar Code Scanner into the form called IAG,
I
want to populate the name from a bragg table into the IAG Form.

It will not populate as of yet.
 
Back
Top