Hi,
The user has changed/added more items to what I thought was a completed item.
Here's the setup:
Form was designed to select a Office, using a listbox from a table.
Same form they added a listbox for jobtable, linked again to a table.
There is a seperate report for each job title, 12 in total.
They want to select some or all the reports depending on the selection from the form, remember that is 12 different reports and then only include data for items(offices) selected from the form.
Here's my code some far:
Private Sub OK_Click()
On Error GoTo err_preview_report_click
Dim title, wclause, RO, rname
For Each RO In Me![Ro_list].ItemsSelected
rname = Me![Ro_list].ItemData(RO)
Next
For Each title In Me![report_list].ItemsSelected
wclause = Me![report_list].ItemData(title)
DoCmd.OpenReport reportname:=wclause, view:=acViewPreview
Next
Mereport_list = ""
Me.[Ro_list] = ""
EXIT_OK_CLICK:
Exit Sub
err_preview_report_click:
MsgBox "Select a report!"
Resume EXIT_OK_CLICK
End Sub
The reports are based on queries:
I have this in the queries:
Like [forms]![frm_srp_sal_ro]![ro_list] & "*"
Each report has a seperate query.
Any thoughts much appreciated.
The user has changed/added more items to what I thought was a completed item.
Here's the setup:
Form was designed to select a Office, using a listbox from a table.
Same form they added a listbox for jobtable, linked again to a table.
There is a seperate report for each job title, 12 in total.
They want to select some or all the reports depending on the selection from the form, remember that is 12 different reports and then only include data for items(offices) selected from the form.
Here's my code some far:
Private Sub OK_Click()
On Error GoTo err_preview_report_click
Dim title, wclause, RO, rname
For Each RO In Me![Ro_list].ItemsSelected
rname = Me![Ro_list].ItemData(RO)
Next
For Each title In Me![report_list].ItemsSelected
wclause = Me![report_list].ItemData(title)
DoCmd.OpenReport reportname:=wclause, view:=acViewPreview
Next
Mereport_list = ""
Me.[Ro_list] = ""
EXIT_OK_CLICK:
Exit Sub
err_preview_report_click:
MsgBox "Select a report!"
Resume EXIT_OK_CLICK
End Sub
The reports are based on queries:
I have this in the queries:
Like [forms]![frm_srp_sal_ro]![ro_list] & "*"
Each report has a seperate query.
Any thoughts much appreciated.