i have this code that updates back-end sql tables from a command button on ms access form. it fails run-time error code 13; type mismatch. when i remove the (AND '" & Not IsNull(Me.TicketNum1) & "') portion of the WHERE clause it runs fine. i added this to make sure to UPDATE only when there is a value in TicketNum1 field. I have no clue what is wrong with this. i am new and i have been trying to figure out how to write this. any help to move me forward on this project would help immensely.
Dim dbCMC1 As DAO.Database
Dim strSQL1 As String
Set dbCMC1 = CurrentDb
strSQL1 = "UPDATE dbo_FieldTicketHeader " & _
"SET dbo_FieldTicketHeader.SONumber = '" & Me.NewSONumber & "' " & _
"WHERE dbo_FieldTicketHeader.FieldTicketNumber = '" & Me.TicketNum1 & "' AND '" & Not IsNull(Me.TicketNum1) & "' "
Debug.Print strSQL1
dbCMC1.Execute strSQL1, dbFailOnError