S
Stewart
I previously posted on this forum a question (to which I got a very helpful
reply) on how to modify the contents of a listbox using VBA code. I got that
part down, but this is my situation: I am previewing a report based on
criteria input on a form. I need to display on the report all the search
criteria that was entered on the form, for example: If you used the form to
display all reports with priority "H" then the report would say "Priority"
under a "Filtered By" heading. The problem is that once you click the button
on the form to generate the report, it says that you cannot change the
contents of the listbox on the report while the report is being made or
viewed. My question is, "Is there a way to store the data of the RowSource
string generated by my VBA code in a variable, and then apply it to the
report's RowSource before the report is previewed?"
VBA code snippit:
If (cboPriority <> " ") Then
filteredstring = filteredstring &
Reports!rptWorkOrder1!lstFiltered.RowSource & "Priority" & ";"
End If
If my guess is correct, I need to assign the filteredstring variable to
RowSource of lstFiltered... but where and when?
Any input is appreciated.
reply) on how to modify the contents of a listbox using VBA code. I got that
part down, but this is my situation: I am previewing a report based on
criteria input on a form. I need to display on the report all the search
criteria that was entered on the form, for example: If you used the form to
display all reports with priority "H" then the report would say "Priority"
under a "Filtered By" heading. The problem is that once you click the button
on the form to generate the report, it says that you cannot change the
contents of the listbox on the report while the report is being made or
viewed. My question is, "Is there a way to store the data of the RowSource
string generated by my VBA code in a variable, and then apply it to the
report's RowSource before the report is previewed?"
VBA code snippit:
If (cboPriority <> " ") Then
filteredstring = filteredstring &
Reports!rptWorkOrder1!lstFiltered.RowSource & "Priority" & ";"
End If
If my guess is correct, I need to assign the filteredstring variable to
RowSource of lstFiltered... but where and when?
Any input is appreciated.