Hi
IMHO, you're using the wrong syntax.
I believe that the criteria that you have in your DLookup will *always*
return one of two things ...
The value of "[cSSN]" (If it exists, ... and I assume that it is supposed
to be numeric) or Null (If it doesn't)
Try it this way:
*************************************
Private Sub Command0_Click()
Dim varFindThis
varFindThis = GetCurrentMemberID()
If IsNumeric(varFindThis) Then ' I'm assuming that the function is supposed
to return a numeric "ID" here
If Not IsNull(DLookup("[cSSN]", "tblAddressesEquifax", "[cSSN] =" &
varFindThis)) Then
Debug.Print "Hello"
Else
Debug.Print "Goodbye"
End If
End If
End Sub
*************************************
Note: This is the *actual* code that I used during testing, which seemed to
work fine:
*************************************
Private Sub Command0_Click()
Dim varFindThis
varFindThis = InputBox("Enter a numeric value to find", "Find a Value")
If IsNumeric(varFindThis) Then
If Not IsNull(DLookup("FacultyName", "tblFaculty", "[FacID] =" &
varFindThis)) Then
Debug.Print "Hello"
Else
Debug.Print "Goodbye"
End If
End If
End Sub
*************************************
--
HTH,
Don
=============================
E-Mail (if you must)
My*****@Telus.net
Disclaimer:
Professional PartsPerson
Amateur Database Programmer {:o)
I'm an Access97 user, so all posted code
samples are also Access97- based
unless otherwise noted.
Do Until SinksIn = True
File/Save, <slam fingers in desk drawer>
Loop
================================
"MLH" <CR**@NorthState.net> wrote in message
news:ti********************************@4ax.com...
if DLookup("[cSSN]", "tblAddressesEquifax",
"[cSSN]=GetCurrentMemberID()") then ? "Hello"
#AND#
if not DLookup("[cSSN]", "tblAddressesEquifax",
"[cSSN]=GetCurrentMemberID()") then ? "Hello"
both result in "Hello" being printed in the immediate
window. Access 2.0. Why???