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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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

QualityEngAuthor Commented:
Thanks Mike but it didn't work.  Any other idea?  I feel like I am missing something fundamental.screen shot
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] & "'")
SolarWinds® VoIP and Network Quality Manager(VNQM)

WAN and VoIP monitoring tools that can help with troubleshooting via an intuitive web interface. Review quality of service data, including jitter, latency, packet loss, and MOS. Troubleshoot call performance and correlate call issues with WAN performance for Cisco and Avaya calls

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.
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

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
QualityEngAuthor Commented:
Thank you giving me solution that i did not ask for.  It really better and in hindsight a obvious solution.
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.