R
Rocky5
I have this code that selects the records to print, however from the string
when I select more than 300 records or so the report will not launch, but it
will on stand alone for over 2000 records.
The error message I get is : " The filter operation was canceled. The Filter
would be too long"
Here is the code. the list box contains the results/ Records I want to
print. Is there a way around that? waht is the limitation on the filter.
Thanks for your help in advance !
..........................................................................................................................................................................................................................................................
Private Sub Command10_Click()
On Error GoTo Err_Command10_Click
Dim varItem As Variant
Dim strSelected As String
strSelected = ""
For Each varItem In Me.lstInstrIssue.ItemsSelected
'If the selected item is numeric, uncomment the following line
strSelected = strSelected & Me.lstInstrIssue.Column(0, varItem) & ","
'If the selected items are textual, uncomment the following line
' strSelected = strSelected & """" & Me.List2.Column(0, varItem) &
""","
Next varItem
'Get rid of the trailing comma
'If the selected item is numeric, uncomment the following line
If Len(strSelected) > 0 Then
strSelected = "(" & Left(strSelected, Len(strSelected) - 1) & ")"
Else
msgg:
MsgBox "You must Select at least one record", vbCritical, "My
Application"
GoTo endit
End If
'If the selected items are textual, uncomment the following line
' strSelected = "(" & Left(strSelected, Len(strSelected) - 2) & """)"
If Len(strSelected) < 0 Then
GoTo msgg
Else
End If
Debug.Print strSelected
'MsgBox "You Selected Record(s) Number " & strSelected
DoCmd.OpenReport "C2 Profibus Loop", acViewPreview, , "CMPNT_ID IN " &
strSelected
endit:
Exit_Command10_Click:
Exit Sub
Err_Command10_Click:
MsgBox Err.Description
Resume Exit_Command10_Click
End Sub
when I select more than 300 records or so the report will not launch, but it
will on stand alone for over 2000 records.
The error message I get is : " The filter operation was canceled. The Filter
would be too long"
Here is the code. the list box contains the results/ Records I want to
print. Is there a way around that? waht is the limitation on the filter.
Thanks for your help in advance !
..........................................................................................................................................................................................................................................................
Private Sub Command10_Click()
On Error GoTo Err_Command10_Click
Dim varItem As Variant
Dim strSelected As String
strSelected = ""
For Each varItem In Me.lstInstrIssue.ItemsSelected
'If the selected item is numeric, uncomment the following line
strSelected = strSelected & Me.lstInstrIssue.Column(0, varItem) & ","
'If the selected items are textual, uncomment the following line
' strSelected = strSelected & """" & Me.List2.Column(0, varItem) &
""","
Next varItem
'Get rid of the trailing comma
'If the selected item is numeric, uncomment the following line
If Len(strSelected) > 0 Then
strSelected = "(" & Left(strSelected, Len(strSelected) - 1) & ")"
Else
msgg:
MsgBox "You must Select at least one record", vbCritical, "My
Application"
GoTo endit
End If
'If the selected items are textual, uncomment the following line
' strSelected = "(" & Left(strSelected, Len(strSelected) - 2) & """)"
If Len(strSelected) < 0 Then
GoTo msgg
Else
End If
Debug.Print strSelected
'MsgBox "You Selected Record(s) Number " & strSelected
DoCmd.OpenReport "C2 Profibus Loop", acViewPreview, , "CMPNT_ID IN " &
strSelected
endit:
Exit_Command10_Click:
Exit Sub
Err_Command10_Click:
MsgBox Err.Description
Resume Exit_Command10_Click
End Sub