I'm new to vb so bear with me... I have a form that browses table1, table1 has an id field. I want to create an IF statement that will take id the current record displayed in the form and check to see if that id exists in table2. Here is what i've been trying to go with but for some reason Statement2 is always being executed, weather "Me.ID.Value" is in table2 or not.
Private Sub Form_Current()
If IsNull("SELECT table2.ID FROM table2 WHERE table2.ID = '" & Me.ID.Value & "'") Then
Statement1
Else
Statement2
End If
End Sub
Private Sub Form_Current()
If IsNull("SELECT table2.ID FROM table2 WHERE table2.ID = '" & Me.ID.Value & "'") Then
Statement1
Else
Statement2
End If
End Sub