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.
QualityEngAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike EghtebasDatabase and Application DeveloperCommented:
=DLookUp("[Customer]"," [dbo_Job]","[Job]= " & char(34) & [Forms]![Printable CoC Form]![Job] & char(34) )

Open in new window

1
QualityEngAuthor Commented:
Thanks Mike but it didn't work.  Any other idea?  I feel like I am missing something fundamental.screen shot
0
Rey Obrero (Capricorn1)Commented:
try this,
if field [job] is Number Data type

=DLookUp("Customer","dbo_Job","[Job]= " & [Forms]![Printable CoC Form]![Job])


if field [job] is Text Data type

=DLookUp("Customer","dbo_Job","[Job]= '" & [Forms]![Printable CoC Form]![Job] & "'")
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
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.
0
PatHartmanCommented:
I rarely use Dlookup()s to fill form fields.  Normally, I use a query that joins to the lookup tables as the form's Record source.  Here is a sample that you might find useful.  See the fourth menu item.
FillFormFields130127.zip
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gustav BrockCIOCommented:
You have too many spaces:

=DLookUp("[Customer]"," [dbo_Job]","[Job]= ' " & [Forms]![Printable CoC Form]![Job] & " ' ")

Use:

=DLookUp("[Customer]","[dbo_Job]","[Job] = '" & [Forms]![Printable CoC Form]![Job] & "'")

/gustav
0
QualityEngAuthor Commented:
Thank you giving me solution that i did not ask for.  It really better and in hindsight a obvious solution.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.