Dlookup

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi I am new to Access please help...

=DLookUp("[Name]","tblPersAddr"," [ssn] = [tblPersAddr]![SSN]")

All I get is the first name in all the fields. What I want is when the ssn
matches to give me that name.

What am I doing wrong and do I also need a not zero/not blank check?

Thank You for any help!
 
Hi I am new to Access please help...

=DLookUp("[Name]","tblPersAddr"," [ssn] = [tblPersAddr]![SSN]")

All I get is the first name in all the fields. What I want is when the ssn
matches to give me that name.

What am I doing wrong and do I also need a not zero/not blank check?

Thank You for any help!

[SSN] should be a Text datatype field.

=DLookUp("[Name]","tblPersAddr","[ssn] = '" & [SSN] & "'")

Also note: Name is a reserved Access/VBA/Jet word and should not be
used as a field name.
For additional reserved words, see the Microsoft KnowledgeBase article
for your version of Access:

109312 'Reserved Words in Microsoft Access' for Access 97
209187 'ACC2000: Reserved Words in Microsoft Access'
286335 'ACC2002: Reserved Words in Microsoft Access'
321266 'ACC2002: Microsoft Jet 4.0 Reserved Words'

For an even more complete list of reserved words, see:
http://www.allenbrowne.com/AppIssueBadWord.html
 
Hi and thank you that worked fine!

As for the Name (I know) I had to work with it you see someone else wrote
this database years ago and I just had to follow what was there (don't want
to get into changing what might be attached to that table).

Again Thank You!


fredg said:
Hi I am new to Access please help...

=DLookUp("[Name]","tblPersAddr"," [ssn] = [tblPersAddr]![SSN]")

All I get is the first name in all the fields. What I want is when the ssn
matches to give me that name.

What am I doing wrong and do I also need a not zero/not blank check?

Thank You for any help!

[SSN] should be a Text datatype field.

=DLookUp("[Name]","tblPersAddr","[ssn] = '" & [SSN] & "'")

Also note: Name is a reserved Access/VBA/Jet word and should not be
used as a field name.
For additional reserved words, see the Microsoft KnowledgeBase article
for your version of Access:

109312 'Reserved Words in Microsoft Access' for Access 97
209187 'ACC2000: Reserved Words in Microsoft Access'
286335 'ACC2002: Reserved Words in Microsoft Access'
321266 'ACC2002: Microsoft Jet 4.0 Reserved Words'

For an even more complete list of reserved words, see:
http://www.allenbrowne.com/AppIssueBadWord.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Dlookup 6
Show Button 3
Saving data 1
Dlookup error 5
Field from another form 9
Conditional Inputmask 1
Check for duplicate before update 9
Fields not updating until I close and reopen 2

Back
Top