xmeb
Technical User
- Jun 5, 2013
- 89
I am getting compile error and syntax error using this code. Anybody know what is wrong with it? Thanks.
Code:
Private Sub Form_Current()
Dim strWhere As String
Dim lngCount As Long
If Not (IsNull(Me![1RegistrationState]) Or (IsNull(Me![1RegistrationNumber]) Or IsNull(Me!ID)) Then
strWhere = "[1RegistrationNumber]='" & Me![1RegistrationNumber] & _
"' AND [1RegistrationState] = '" & Me.[1RegistrationState] & "' AND ID<>" & Me!ID
lngCount = DCount("*", "ParkingTicketsIssuedTable", strWhere)
If lngCount > 0 Then
MsgBox lngCount & " duplicate registration number(s) exist(s) in the table."
End If
End If
End Sub