Thinking out loud, creating a 'modular' report (1 Viewer)

eibyer_apc

New member
Local time
Today, 11:22
Joined
Mar 1, 2022
Messages
18
My first Access db project is a personnel db that includes the usual demographic info, rate, tax, license (expiration, etc, if any), notes and other bits of info. My first report I created had all this info in it and it worked out just fine. Then I needed another slimmed down report that does not include rates or taxes, and so on, I end up having to modify the original detailed report to create another report with less detail.

So now I'm thinking maybe it's possible to do a modular report?

I'm thinking of a set of controls like below:
Print Report (button) Include: Rate[ ] Taxes[ ] License[ ] Notes[ ] (check boxes)

The report will include the demographic as base and include the information based on what check boxes are selected. Is this possible with subreports that can be hidden/shown dynamically?
 

isladogs

MVP / VIP
Local time
Today, 18:22
Joined
Jan 14, 2017
Messages
18,186
Yes you can create reports that show different items (either controls or subreports) depending on options selected.
The simplest way is probably to use open args in the calling form, then use a select case statement based on Me.OpenArgs in the Report_Open event where each case will show / hide different items.
 

eibyer_apc

New member
Local time
Today, 11:22
Joined
Mar 1, 2022
Messages
18
Thanks, I will try and mock up something to see if I can actually accomplish this. My ideas are not on same level as my access skills lol.
 

isladogs

MVP / VIP
Local time
Today, 18:22
Joined
Jan 14, 2017
Messages
18,186
Another approach uses the Tag property. To get an idea how that can be used, see my example app
 

eibyer_apc

New member
Local time
Today, 11:22
Joined
Mar 1, 2022
Messages
18
Hot dang, it worked!
Private Sub Command0_Click()
Reports("_rptTest").subrptSingleEmpRateList.Visible = True
Reports("_rptTest").subrptSingleEmpTaxList.Visible = True

End Sub
 

eibyer_apc

New member
Local time
Today, 11:22
Joined
Mar 1, 2022
Messages
18
Thanks! I don't normally do that, just on this test so the report is listed on top :)
 

Users who are viewing this thread

Top Bottom