Hi all,
I have a command button on my switchboard that was working before and now it's not. The button is supposed to open a report showing books that have been overdue for 1 week. When I click the button I get this error:
Syntax error (missing operator) in query expression 'count[UserID]'.
The button houses the following code:
'OPENS THE REPORT FOR OVERALL BOOKS DUE/OVERDUE
Private Sub cmdOverallBooksDue_Click()
On Error GoTo Err_cmdOverallBooksDue_Click
Dim stDocName As String
If DLookup("count[UserID]", "[qryOverallBooksDue]", "criteria") < 1 Then
MsgBox "No books overdue."
Exit Sub
Else
DoCmd.OpenReport "rptOverallBooksDue"
End If
Exit_cmdOverallBooksDue_Click:
Exit Sub
Err_cmdOverallBooksDue_Click:
MsgBox Err.Description
Resume Exit_cmdOverallBooksDue_Click
End Sub
Any thoughts?
bajanJedi
I have a command button on my switchboard that was working before and now it's not. The button is supposed to open a report showing books that have been overdue for 1 week. When I click the button I get this error:
Syntax error (missing operator) in query expression 'count[UserID]'.
The button houses the following code:
'OPENS THE REPORT FOR OVERALL BOOKS DUE/OVERDUE
Private Sub cmdOverallBooksDue_Click()
On Error GoTo Err_cmdOverallBooksDue_Click
Dim stDocName As String
If DLookup("count[UserID]", "[qryOverallBooksDue]", "criteria") < 1 Then
MsgBox "No books overdue."
Exit Sub
Else
DoCmd.OpenReport "rptOverallBooksDue"
End If
Exit_cmdOverallBooksDue_Click:
Exit Sub
Err_cmdOverallBooksDue_Click:
MsgBox Err.Description
Resume Exit_cmdOverallBooksDue_Click
End Sub
Any thoughts?
bajanJedi