I used the following code to look for a dulicate entry in a table vs a field on a form. Everything seems to work ok, BUT I'm trying to use and IF THEN statement based on the value of a variant, and it doesn't work at all! If the variant = null then the intSkip = 2. If the variant = 'something' then the intSkip = 2. Why is this???
Dim stDocName As String
Dim varDupe As Variant
Dim inSkip As Integer
stDocName = "qryPlaylist_Save"
varDupe = DLookup("[Playlist]", "tblPlayLists", "[Playlist] = [txtPlaylistname]")
If varDupe = Null Then inSkip = 1 Else inSkip = 2
Dim stDocName As String
Dim varDupe As Variant
Dim inSkip As Integer
stDocName = "qryPlaylist_Save"
varDupe = DLookup("[Playlist]", "tblPlayLists", "[Playlist] = [txtPlaylistname]")
If varDupe = Null Then inSkip = 1 Else inSkip = 2