Hello,
Thanks for any help. I have a list box in a form. The items in the list are derieved from a query. The items can change depending on the information. I want to create a button that will print all the reports based on the items in the list. I have already created a button to click the items in the list and print individual reports.
Duane said:
If you want to open multiple reports with each filtered based on the value of a list box, then consider:
Dim strWhere as String
strWhere = "[ItemID]=" & Me.lboItemID
DoCmd.OpenReport "rptA", , ,strWhere
DoCmd.OpenReport "rptB", , ,strWhere
DoCmd.OpenReport "rptC", , ,strWhere
'etc
My concern:Thanks for the reply. I am quite a newbie here. I assume [ItemD] stands for the list index. If so, my concern is that since the list will vary everytime, so will the list indexes. In that case rptA will print no matter if it is in the list or not.
Thanks for any help. I have a list box in a form. The items in the list are derieved from a query. The items can change depending on the information. I want to create a button that will print all the reports based on the items in the list. I have already created a button to click the items in the list and print individual reports.
Duane said:
If you want to open multiple reports with each filtered based on the value of a list box, then consider:
Dim strWhere as String
strWhere = "[ItemID]=" & Me.lboItemID
DoCmd.OpenReport "rptA", , ,strWhere
DoCmd.OpenReport "rptB", , ,strWhere
DoCmd.OpenReport "rptC", , ,strWhere
'etc
My concern:Thanks for the reply. I am quite a newbie here. I assume [ItemD] stands for the list index. If so, my concern is that since the list will vary everytime, so will the list indexes. In that case rptA will print no matter if it is in the list or not.