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 = GetCurrentMembe rID()
If IsNumeric(varFi ndThis) Then ' I'm assuming that the function is supposed
to return a numeric "ID" here
If Not IsNull(DLookup( "[cSSN]", "tblAddressesEq uifax", "[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(varFi ndThis) Then
If Not IsNull(DLookup( "FacultyNam e", "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.n et
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**@NorthStat e.net> wrote in message
news:ti******** *************** *********@4ax.c om...
if DLookup("[cSSN]", "tblAddressesEq uifax",
"[cSSN]=GetCurrentMemb erID()") then ? "Hello"
#AND#
if not DLookup("[cSSN]", "tblAddressesEq uifax",
"[cSSN]=GetCurrentMemb erID()") then ? "Hello"
both result in "Hello" being printed in the immediate
window. Access 2.0. Why???