Yes, what your co-worker showed you is that different types need different delimiters when used in such a code statement. You discovered that for string or text fields, it should look like.
Code:
DLookUp("Vendor_Name","ROR_Vendor","Vendor_Name = '" & [Forms]![Purchase Order]![Vendor_Name] & "'")
If Vendor_Name was a date instead of a string, then
Code:
DLookUp("Vendor_Name","ROR_Vendor","Vendor_Name = #" & [Forms]![Purchase Order]![Vendor_Name] & "#")
If Vendor_Name was a number or boolean (yes/no, true/false), then you'd have
Code:
DLookUp("Vendor_Name","ROR_Vendor","Vendor_Name = " & [Forms]![Purchase Order]![Vendor_Name])
Frankly, if Access is smart enough to error out because the types don't match, it should have be smart enough to find out what type it
should have been from the table definition and figured out that Vendor_Name was a string. It's like when you get an error that you forgot to put a closing quote or parenthesis on a statement in VBA. If Access is smart enough to know that, why doesn't it just auto-insert it?
