Go Back   Access World Forums > Microsoft Access Discussion > Reports

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-12-2018, 04:55 PM   #1
JCapp
Newly Registered User
 
Join Date: Oct 2018
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
JCapp is on a distinguished road
Creating a VBA Subreport in Access

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.

JCapp is offline   Reply With Quote
Old 10-12-2018, 06:04 PM   #2
JHB
Have been here a while
 
Join Date: Jun 2012
Location: In the south of Denmark (Jutland), near the German border.
Posts: 7,554
Thanks: 2
Thanked 2,024 Times in 1,980 Posts
JHB has a spectacular aura about JHB has a spectacular aura about
Re: Creating a VBA Subreport in Access

Quote:
Originally Posted by JCapp View Post
..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.
__________________
If the above post has helped you, why not take the time to say thank you, by pressing the "Thumbs up."
JHB is offline   Reply With Quote
Old 11-04-2018, 02:07 AM   #3
soap
Newly Registered User
 
Join Date: Nov 2018
Posts: 25
Thanks: 4
Thanked 0 Times in 0 Posts
soap is on a distinguished road
Re: Creating a VBA Subreport in Access

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.

soap is offline   Reply With Quote
Old 11-04-2018, 03:59 PM   #4
MajP
Newly Registered User
 
Join Date: May 2018
Location: USA baby
Posts: 1,182
Thanks: 22
Thanked 317 Times in 306 Posts
MajP will become famous soon enough MajP will become famous soon enough
Re: Creating a VBA Subreport in Access

Quote:
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/art...2-4a23ac0fdbf3

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

MajP is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to force a page break in 1st subreport based on info in 2nd or 3rd subreport SallyJenkins Reports 0 02-19-2013 10:32 AM
HasData check in subReport within subreport on mainreport tfin Reports 2 06-25-2009 10:14 PM
Text Box on report, needs to show value on subreport, even if subreport not there ! Davepacey Reports 4 06-23-2003 10:20 AM
Need help creating a report with a crosstab report as a subreport Kenneth Reports 0 05-31-2000 03:05 AM




All times are GMT -8. The time now is 06:23 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World