S
S. Jackson
I have a dialog form for users to select certain criteria before printing
reports. Some of the reports (not all) allow the user to make a selection
from the ActionListbox. When they do the following runs behind the View
Report command button:
'if report can be printed using action criteria, and user selects same
If Me.ActionListBx.ItemsSelected.Count > 0 Then
stLinkCriteria = stLinkCriteria & " AND [tblCaseInfo]![Action]IN ("
For Each varItem In Me.ActionListBx.ItemsSelected
stLinkCriteria = stLinkCriteria & _
Chr$(34) & _
Me.ActionListBx.ItemData(varItem) & _
Chr$(34) & ","
Next varItem
stLinkCriteria = Left(stLinkCriteria, Len(stLinkCriteria) - 1) & ")"
End If
The problem I'm having is that if a user selects a report that allows him to
select criteria from the ActionListBx, then goes back and selects a report
that does NOT allow a selection from the ActionListBx, I get a request to
enter a Action Parameter when the query for that report runs because the
code above still thinks that Me.ActionListBx.ItemsSelected.Count is >0. How
do I return the value of the ActionListBx.ItemsSelected.Count to Zero? And,
can I do this before the End If statement, or do I need to put it under the
AfterUpdate Event on the ReportListBx?
TIA
Shelly
reports. Some of the reports (not all) allow the user to make a selection
from the ActionListbox. When they do the following runs behind the View
Report command button:
'if report can be printed using action criteria, and user selects same
If Me.ActionListBx.ItemsSelected.Count > 0 Then
stLinkCriteria = stLinkCriteria & " AND [tblCaseInfo]![Action]IN ("
For Each varItem In Me.ActionListBx.ItemsSelected
stLinkCriteria = stLinkCriteria & _
Chr$(34) & _
Me.ActionListBx.ItemData(varItem) & _
Chr$(34) & ","
Next varItem
stLinkCriteria = Left(stLinkCriteria, Len(stLinkCriteria) - 1) & ")"
End If
The problem I'm having is that if a user selects a report that allows him to
select criteria from the ActionListBx, then goes back and selects a report
that does NOT allow a selection from the ActionListBx, I get a request to
enter a Action Parameter when the query for that report runs because the
code above still thinks that Me.ActionListBx.ItemsSelected.Count is >0. How
do I return the value of the ActionListBx.ItemsSelected.Count to Zero? And,
can I do this before the End If statement, or do I need to put it under the
AfterUpdate Event on the ReportListBx?
TIA
Shelly