xmeb
Technical User
- Jun 5, 2013
- 89
I am trying to use the following code to alert users to how many registration numbers are in the table that have been issued parking tickets. I keep getting a compile error. What's 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.ID)) Then
strWhere = "(1RegistrationState = """ & Me.1RegistrationState & _
""") AND (ID <> " & Me.ID & ")"
lngCount = DCount("*", "ParkingTicketsIssuedTable", strWhere)
If lngCount > 0 Then
MsdgBox lngCount & "Other registration number(s) exist."
End If
End If
End Sub