I get this error in my form command button control, in the on-click event:
Run-time error '3075':
|1 in query expression '|2'.
--------------------------
This is the code in that event:
The error highlights the line
when I debug the strcriteria, it comes out like this:
Anyone know what is going on?
Thanks!
misscrf
It is never too late to become what you could have been ~ George Eliot
Run-time error '3075':
|1 in query expression '|2'.
--------------------------
This is the code in that event:
Code:
Private Sub cmdExDetRptSel_Click()
Dim strDocName As String
Dim strcriteria As String
Dim strOpenArgs As String
Dim strRgroup As Integer
Dim strSQL As String
strDocName = "rptProjExDetail"
If Me.lstExceptionTypes.ItemsSelected.Count = 0 Then
MsgBox "You have no exclusions selected, please select 1 or more to run for selected exclusions.", vbOKOnly, "Please Select Some Exclusions"
End If
strcriteria = "[Projectgroupkey] = '" & Me.txtProjectGroupKey.Value & "'"
strcriteria = strcriteria & _
BuildIn(Me.lstExceptionTypes, "[ExType]", "'")
If Me.chkRptByBatch = -1 Then
strOpenArgs = 1
Else
strOpenArgs = 0
End If
DoCmd.OpenReport strDocName, acViewPreview, , strcriteria, , strOpenArgs
[Forms]![frmReportExclusionsMenu].Visible = False
End Sub
The error highlights the line
Code:
DoCmd.OpenReport strDocName, acViewPreview, , strcriteria, , strOpenArgs
when I debug the strcriteria, it comes out like this:
Code:
[Projectgroupkey] = '123456ProjectABC' AND [ExType] In ('Corrupt File')
Anyone know what is going on?
Thanks!
misscrf
It is never too late to become what you could have been ~ George Eliot