Pyro
Too busy to comment
- Local time
- Tomorrow, 06:39
- Joined
- Apr 2, 2009
- Messages
- 127
Hi, i am trying to run the following piece of code:
If the value that it is checking is numeric, everything works fine. If it is a string, i get "Run-time error '13': Type Mismatch". The field in the table has stored text and numeric values. The form is built on a query of multiple tables.
Any ideas as to what is going on?
Code:
If DLookup("lotno", "[tbl_track_expiry]", "lotno = '" & [txtlotno] & "'") Then
If MsgBox("The Batch Number you are trying to enter already exists in the system." & vbCrLf & _
" " & vbCrLf & _
"Press OK to go to that record, or cancel to undo this entry.", vbOKCancel, "Alert") = vbOK Then
Me.RecordsetClone.FindFirst "[track_expiry_lotno] = '" & [txtlotno] & "'"
Me.undo
Me.Bookmark = Me.RecordsetClone.Bookmark
Else
Me.undo
End If
Else
Me.txtlotno = Me.txtlotno
End If
If the value that it is checking is numeric, everything works fine. If it is a string, i get "Run-time error '13': Type Mismatch". The field in the table has stored text and numeric values. The form is built on a query of multiple tables.
Any ideas as to what is going on?