I have a report I am trying to limit down. I keep getting this error.
Here is some of my code. What am I missing?
Code:
Run-time error '3075':
Syntax error (missing operator) in query expression ' and (Exercise = Barbell Squat)'.
Code:
Dim whereCond As String
Forms!frmReports!cmdExercise.SetFocus
Exercise = Forms!frmReports!cmdExercise.Text
Forms!frmReports!cmdCategory.SetFocus
Category = Forms!frmReports!cmdCategory.Text
If Category <> "" Then
whereCond = whereCond & " and (Category = " & Forms!frmReports!cmdCategory.value & ")"
End If
'Apply the Exercise filter is there is one.
If Exercise <> "" Then
whereCond = whereCond & " and (Exercise = " & Forms!frmReports!cmdExercise.value & ")"
End If
'Open the report
DoCmd.OpenReport "rptFitNotesSummary", acViewPreview, , whereCond