Creating a VBA Subreport in Access (1 Viewer)

JCapp

New member
Local time
Yesterday, 20:30
Joined
Oct 13, 2018
Messages
1
Good evening all,
I am new to using VBA in Access and have been tasked with creating updates for a tool at work. They want as much as possible to be based on VBA code due to the size of the tool/database we're working with.
I have a main report that displays the top 25 systems based off of a group number variable. I have another report that displays the top 25 part numbers that all belong to a certain group number. What I need to do is create a Subreport in VBA code for when the Group Report loads (on load) for the part numbers Report to be listed under their corresponding group number.
I know how to insert the subreport and all of that inside access itself and it works beautifully, but that's not what they're looking for. I also need to create a little plus thingy (very technical term) in the top left corner of the subreport to collapse or expand it, but I can manage that.....I think haha. Thanks for any input you guys can provide.
 

JHB

Have been here a while
Local time
Today, 02:30
Joined
Jun 17, 2012
Messages
7,732
..They want as much as possible to be based on VBA code due to the size of the tool/database we're working with.
...
I can't follow that statement, why do they think a lot of VBA code should reduce the database size versus an already created report?
What really increases a database in size, is if images are stored direct in a MS-Access database, or if queries are run where many data are involved, that really bloat a MS-Access database, (therefore remember to do a Compact & Repair).
Remember a report is more a static view of data, (printed on paper), I you want something to expand/collapse then use a form.
 

soap

Registered User.
Local time
Yesterday, 17:30
Joined
Nov 4, 2018
Messages
25
I have a similar issue on subreport but everything is merged together. The issue here is that the subreport generated from a subform does not create a page break whenever the data value exiceeds 10. kindly assist.
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 20:30
Joined
May 21, 2018
Messages
8,525
I have a main report that displays the top 25 systems based off of a group number variable. I have another report that displays the top 25 part numbers that all belong to a certain group number. What I need to do is create a Subreport in VBA code for when the Group Report loads (on load) for the part numbers Report to be listed under their corresponding group number.

Have you looked at "Sorting and Grouping"? The way you describe it sounds to me it is just a simple grouped report.

You Group on System and then under each System you have the part details. This requires no code or subreports.

https://support.office.com/en-us/ar...y-report-f23301a1-3e0a-4243-9002-4a23ac0fdbf3

You may want to look at a few videos online since there is a lot you can do with grouping.
 

Users who are viewing this thread

Top Bottom