BradCollins
Technical User
Hi all,
I have read through the countless posts on this problem and I still cant see where I have gone wrong, I am hoping someone can see where I have messed up with this code. When I run it as a runtime I get the error
3075 : Syntax error (missing operator) in query expression 'aa12-aa12-aa12'
The feild is a serial number field and I want it to ensure there is no existing serial number, of course the numbers can take any format including having alpha characters.
Thanks in advance to anyone whoc an assist me
I have read through the countless posts on this problem and I still cant see where I have gone wrong, I am hoping someone can see where I have messed up with this code. When I run it as a runtime I get the error
3075 : Syntax error (missing operator) in query expression 'aa12-aa12-aa12'
The feild is a serial number field and I want it to ensure there is no existing serial number, of course the numbers can take any format including having alpha characters.
Code:
Dim SerialNo As String
Dim strSerial As String
SerialNo = Me.fldSerialNo.Value
strSerial = Nz(DLookup(SerialNo, "tblSW", "fldSerialNo = """ & Me.fldSerialNo & """"), "")
If Len(strSerial) > 0 Then
MsgBox "This serial number already exists, please" & Chr$(13) & "enter a diferent number.", _
vbInformation, "The Final Solution"
Cancel = True
Else
End If
Thanks in advance to anyone whoc an assist me