Dlookup

A

Amour

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!
 
F

fredg

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
 
A

Amour

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
 
Top