By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,347 Members | 2,113 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,347 IT Pros & Developers. It's quick & easy.

Dlookup Field in query not returning values; field blank

P: 44
I have 2 tables. Once called tblPerson and the other tblMember for a church database, where I am trying to replace the ID field with their name from the tblperson table. I have the following Dlookup in the query:

Shepherd: Dlookup("[F_Name]","[tblPerson]","[MPersonID]='"&[PersonID]&"'")

When I run the query with this DLookup no errors, no values. Field is just blank.

Sample of Table:

TblMember
MPersonID (PK)
Status
YearJoined
(etc)

TblPerson
PersonID (PK)
F_Name
L_Name
DOB
Mobile

Can you please help me figure out why no values are returning when data is both the tables
Mar 6 '19 #1

✓ answered by twinnyfo

brikusi,

Welcome to Bytes!

It looks like you have your IDs reversed. Also, remove the single quotes from your expression. If you are dealing with numerical PK's (as they should be), sincle quotes are unnecessary.

Shepherd: Dlookup("[F_Name]","[tblPerson]","[PersonID]="&[MPersonID])

Hope this hepps.

Share this Question
Share on Google+
3 Replies


twinnyfo
Expert Mod 2.5K+
P: 3,284
brikusi,

Welcome to Bytes!

It looks like you have your IDs reversed. Also, remove the single quotes from your expression. If you are dealing with numerical PK's (as they should be), sincle quotes are unnecessary.

Shepherd: Dlookup("[F_Name]","[tblPerson]","[PersonID]="&[MPersonID])

Hope this hepps.
Mar 6 '19 #2

P: 44
Omg it worked!!! Thank you! Thank you!
Mar 7 '19 #3

twinnyfo
Expert Mod 2.5K+
P: 3,284
Glad I could hepp! Let me know if you need anything else.
Mar 7 '19 #4

Post your reply

Sign in to post your reply or Sign up for a free account.