C
chrisc
Hello,
I'm using the following code on an add new record button on a form in
my database:
Dim rs As Recordset
Set rs = Me.RecordsetClone
Serial_No.SetFocus
rs.FindFirst "[Serial_No] = " & [Serial_No].Text
If Not rs.NoMatch Then
MsgBox "Serial: " & [Serial_No] & " Is Already In Use, This Item
Does Not Need To Be Re-Entered!", vbOKOnly + vbCritical
Else
DoCmd.GoToRecord , , acNewRec
End If
End If
End Sub
on line 4 I get a runtime error 3464 which is a datatype mismatch.
The reason it has to be text is as our serial numbers are not just
numbers, otherwise I'd use a datatype of number and change my code to
..value, which I have tested and does work.
Does anyone have a solution to this problem? Would be much
appreciated.
Chris.
I'm using the following code on an add new record button on a form in
my database:
Dim rs As Recordset
Set rs = Me.RecordsetClone
Serial_No.SetFocus
rs.FindFirst "[Serial_No] = " & [Serial_No].Text
If Not rs.NoMatch Then
MsgBox "Serial: " & [Serial_No] & " Is Already In Use, This Item
Does Not Need To Be Re-Entered!", vbOKOnly + vbCritical
Else
DoCmd.GoToRecord , , acNewRec
End If
End If
End Sub
on line 4 I get a runtime error 3464 which is a datatype mismatch.
The reason it has to be text is as our serial numbers are not just
numbers, otherwise I'd use a datatype of number and change my code to
..value, which I have tested and does work.
Does anyone have a solution to this problem? Would be much
appreciated.
Chris.