Jimmy Warpup
2009-02-18 23:32:53 UTC
can someone tell me why the following code only runs the "else" criterion?
Private Sub French_word_BeforeUpdate(Cancel As Integer)
MsgBox "begining"
'troubleshooting make sure sub is being run at right time. it does.
MsgBox IsNull(DLookup("[French_word]", "[Words]", "[French_word] = """ &
Me![French_word] & """"))
'troubleshooting to see what the line returned. if the word is in the
database then it returns false if the word is not it returns true.
Select Case Me.French_Word
Case IsNull(DLookup("[French_word]", "[Words]", "[French_word] = """ &
Me![French_word] & """")) = False
MsgBox "first case"
Exit Sub
Case IsNull(DLookup("[French_word]", "[Words]", "[French_word] = """ &
Me![French_word] & """")) = True
MsgBox "not isnul"
Case Else
MsgBox "No workie workie " & Me!French_word & " " &
DLookup("[French_word]", "[Words]", "[French_word] = """ & Me![French_word]
& """")
Exit Sub
End Select
End Sub
Private Sub French_word_BeforeUpdate(Cancel As Integer)
MsgBox "begining"
'troubleshooting make sure sub is being run at right time. it does.
MsgBox IsNull(DLookup("[French_word]", "[Words]", "[French_word] = """ &
Me![French_word] & """"))
'troubleshooting to see what the line returned. if the word is in the
database then it returns false if the word is not it returns true.
Select Case Me.French_Word
Case IsNull(DLookup("[French_word]", "[Words]", "[French_word] = """ &
Me![French_word] & """")) = False
MsgBox "first case"
Exit Sub
Case IsNull(DLookup("[French_word]", "[Words]", "[French_word] = """ &
Me![French_word] & """")) = True
MsgBox "not isnul"
Case Else
MsgBox "No workie workie " & Me!French_word & " " &
DLookup("[French_word]", "[Words]", "[French_word] = """ & Me![French_word]
& """")
Exit Sub
End Select
End Sub