QualityEng
asked on
Having trouble with Dlookup
I am running Access 2010 and would like to auto populate text into a number of cells on a form a OBDC connection. I have the connection setup and seems to work fine. I have input the following into a text box (Source Control)
=DLookUp("[Customer]"," [dbo_Job]","[Job]= ' " & [Forms]![Printable CoC Form]![Job] & " ' ")
I have tried a number similar permutation but haven't got it to work.
Thank you for you assistance.
=DLookUp("[Customer]"," [dbo_Job]","[Job]= ' " & [Forms]![Printable CoC Form]![Job] & " ' ")
I have tried a number similar permutation but haven't got it to work.
Thank you for you assistance.
ASKER
try this,
if field [job] is Number Data type
=DLookUp("Customer","dbo_J ob","[Job] = " & [Forms]![Printable CoC Form]![Job])
if field [job] is Text Data type
=DLookUp("Customer","dbo_J ob","[Job] = '" & [Forms]![Printable CoC Form]![Job] & "'")
if field [job] is Number Data type
=DLookUp("Customer","dbo_J
if field [job] is Text Data type
=DLookUp("Customer","dbo_J
If job# is a numeric, it needs to be:
=DLookUp("[Customer]"," [dbo_Job]","[Job]=" & [Forms]![Printable CoC Form]![Job])
also in that second screen shot, second Dlookup has :
[Sales Order#:]=
as part of the 3rd argument.
You want the name of the field only. Hopefully, that really doesn't contain spaces and the colon in it.
See your "next door" too (somewhat). ...I'm in Syracuse.
Jim.
=DLookUp("[Customer]"," [dbo_Job]","[Job]=" & [Forms]![Printable CoC Form]![Job])
also in that second screen shot, second Dlookup has :
[Sales Order#:]=
as part of the 3rd argument.
You want the name of the field only. Hopefully, that really doesn't contain spaces and the colon in it.
See your "next door" too (somewhat). ...I'm in Syracuse.
Jim.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You have too many spaces:
=DLookUp("[Customer]"," [dbo_Job]","[Job]= ' " & [Forms]![Printable CoC Form]![Job] & " ' ")
Use:
=DLookUp("[Customer]","[db o_Job]","[ Job] = '" & [Forms]![Printable CoC Form]![Job] & "'")
/gustav
=DLookUp("[Customer]"," [dbo_Job]","[Job]= ' " & [Forms]![Printable CoC Form]![Job] & " ' ")
Use:
=DLookUp("[Customer]","[db
/gustav
ASKER
Thank you giving me solution that i did not ask for. It really better and in hindsight a obvious solution.
Open in new window