I know this is something simple....but I am not seeing the obvious...
Here is the code on frmLabelOptions...What i am trying to do is click on a check box(es) on frmLabelOptions, then open a report based on the check box(es) selected.
Private Sub Command30_Click()
Dim strWhere As String
Dim stDocName As String
strWhere = "where 1=1"
stDocName = rptSKLabelsBuysSvcs
If Me.Elem = True Then
strWhere = strWhere & " or (qrySKLabelsBuysSvcs.tblDistricts.ElementarySchool = true)"
End If
If Me.Inter = True Then
strWhere = strWhere & " or (qrySKLabelsBuysSvcs.tblDistricts.IntermediateSchool = true)"
End If
If Me.Mid = True Then
strWhere = strWhere & " or (qrySKLabelsBuysSvcs.tblDistricts.MiddleSchool = true)"
End If
If Me.High = True Then
strWhere = strWhere & " or (qrySKLabelsBuysSvcs.tblDistricts.HighSchool = true)"
End If
DoCmd.OpenReport "rptSKLabelsBuysSvcs", acPreview, , strWhere
End Sub
This is the error I am getting...
Run-time error '3075':
Syntax error (missing operator) in query expression '(where 1=1 or (qrySKLabelsBuysSvcs.tblDistricts.ElementarySchool=true))'.
What am I missing?
Thanks in advance!
Here is the code on frmLabelOptions...What i am trying to do is click on a check box(es) on frmLabelOptions, then open a report based on the check box(es) selected.
Private Sub Command30_Click()
Dim strWhere As String
Dim stDocName As String
strWhere = "where 1=1"
stDocName = rptSKLabelsBuysSvcs
If Me.Elem = True Then
strWhere = strWhere & " or (qrySKLabelsBuysSvcs.tblDistricts.ElementarySchool = true)"
End If
If Me.Inter = True Then
strWhere = strWhere & " or (qrySKLabelsBuysSvcs.tblDistricts.IntermediateSchool = true)"
End If
If Me.Mid = True Then
strWhere = strWhere & " or (qrySKLabelsBuysSvcs.tblDistricts.MiddleSchool = true)"
End If
If Me.High = True Then
strWhere = strWhere & " or (qrySKLabelsBuysSvcs.tblDistricts.HighSchool = true)"
End If
DoCmd.OpenReport "rptSKLabelsBuysSvcs", acPreview, , strWhere
End Sub
This is the error I am getting...
Run-time error '3075':
Syntax error (missing operator) in query expression '(where 1=1 or (qrySKLabelsBuysSvcs.tblDistricts.ElementarySchool=true))'.
What am I missing?
Thanks in advance!