@safeway.com wrote:
This is what I have
=DLookUp("[NAME]","tblSSIMSVendors","[VENDNUM] = " &
me.SupplierNumber)
name is the itemdescription field,
tblSSIMSVendors is the table
ITEMNUM is itemnumber
SupplierNumber is the control source of the textbox where I input the
item code.
It shows up as a #NAME.
Ryan,
I beg your pardon. I did suggest you use an unbound text control to
place the DLookUp in, but then I gave you the syntax to use as though
you were writing VBA code (using Me.[txtControlName]).
My goof.
The Me. keyword can be used when writing code. It is NOT recognized by
the Access Jet engine when used in an Access control source.
So here is the correct syntax, using your above field and control
names:
=DLookUp("[NAME]","tblSSIMSVendors","[VENDNUM] = " &
[SupplierNumber])
You must make sure the name of this control is NOT the same as the
name of any field used in the above expression.
Now I see an additional problem with you using "Name" as the name of
your Item Description field.
"Name" is a reserved Access/VBA/Jet word and should not be used as a
field name.
For additional reserved words, see the Microsoft KnowledgeBase article
286335 'ACC2002: Reserved Words in Microsoft Access'
321266 'ACC2002: Microsoft Jet 4.0 Reserved Words'
For an even more complete list of reserved words, see:
http://www.allenbrowne.com/AppIssueBadWord.html
So change the name of the [Name] field to something else, i.e.
[ItemName], and make sure that the control's name is not the same as
any of the fields used in it's control source and all should be well.