associates
IS-IT--Management
Hi,
I've got this error '7769' when trying to send 6000 records to a report for preview. The error says "The filter operation was cancelled. The filter would be too long". This is to do with the stlinkcriteria. Is there a limit in size as to how long the text is allowed to be put into stlinkcriteria.
What happen here is i have a form that has a listbox and a button called "Summary report". This button is to pass whatever records shown in the listbox onto a report. At the moment, there are about 6000 items there and i pass them by ID which is made up of 4 digits eg.0000.
Here is my code written as follows:
Private Sub CM_SumReport_Click()
Dim stDocName As String
Dim stLinkCriteria As String
nList = Me.myList.ListCount
For ncount = 0 To nList - 1
stLinkCriteria = "," & Me.myList.ItemData(ncount) & stLinkCriteria
Next ncount
If Len(stLinkCriteria) > 0 Then
stLinkCriteria = "[TimeSheet_ID] In (" & Mid(stLinkCriteria, 2) & ")"
End If
'MsgBox stLinkCriteria
stDocName = "Timesheet_SumReport" ' for producing timesheet summary report
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
End Sub
Is there any way to get around this problem?
Thank you very much in advance and look forward to hearing from you.
I've got this error '7769' when trying to send 6000 records to a report for preview. The error says "The filter operation was cancelled. The filter would be too long". This is to do with the stlinkcriteria. Is there a limit in size as to how long the text is allowed to be put into stlinkcriteria.
What happen here is i have a form that has a listbox and a button called "Summary report". This button is to pass whatever records shown in the listbox onto a report. At the moment, there are about 6000 items there and i pass them by ID which is made up of 4 digits eg.0000.
Here is my code written as follows:
Private Sub CM_SumReport_Click()
Dim stDocName As String
Dim stLinkCriteria As String
nList = Me.myList.ListCount
For ncount = 0 To nList - 1
stLinkCriteria = "," & Me.myList.ItemData(ncount) & stLinkCriteria
Next ncount
If Len(stLinkCriteria) > 0 Then
stLinkCriteria = "[TimeSheet_ID] In (" & Mid(stLinkCriteria, 2) & ")"
End If
'MsgBox stLinkCriteria
stDocName = "Timesheet_SumReport" ' for producing timesheet summary report
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
End Sub
Is there any way to get around this problem?
Thank you very much in advance and look forward to hearing from you.