I am working within a DB I have been devolping in Access 2003, and have encountered a report coding issue I was hoping someone could help me with:
I have 18 reports, each running off some smaller queried version of 2 main queries (apx. 6000 records each). The purposes of the DB and the reports require the formatting of these reports to change monthly as Actual Revenue is reported.
I can accomplish all of these monthly formatting changes based on visible true/false code. However, this code turns reports that were taking 5-7 seconds to open into reports that are taking around 2 minutes to open. (This is of course unacceptable!)
The details: There are 216 fields in the details, header, and footer, 18 of which need to be reset as visible true/false each month. I have it currently set up as 36 Private Subs (three per month, one for each details & header & footer). These are set up as 96, 96, and 24-line codes resembling the following:
Private Sub JanVisibilityDe tails()
Me![JanActuals].Visible = True
Me![JanFinalProj].Visible = True
Me![JanDiffAct].Visible = True
Me![JanDiffPercAct].Visible = True
Me![JanProjC].Visible = False
.....
The Visible True/False setting are listed for each of the 216 fields in each Sub.
These are then called with Case "" statements, such as:
Private Sub Detail_Format(C ancel As Integer, FormatCount As Integer)
Select Case Me![Month]
Case "Jan"
Call JanVisibilityDe tails
Case "Feb"
Call FebVisibilityDe tails
.....
This is all done within the Report Code of each individual report.
I have tried various adjustments, like having the code under each Format Sub case, rather than having each case call a separate Private Sub. Same speed. I changed the report to be looking up a table, and no change to speed. Even just having only the current month's Visible True/False code (without any select case) is still ridiculously slow. So I'm pretty sure it's the 216 lines of formatting code that is slowing everything down, but I'm not sure how to fix this. I'm currently changing visibility by hand in the reports, but I'd really like some kind of automated solution.
I'm a trial-and-error, self-taught user who is still relatively new to VB programming code and DB development. Any help anyone can give me would be very much appreciated.
Thanks!
Carrie
I have 18 reports, each running off some smaller queried version of 2 main queries (apx. 6000 records each). The purposes of the DB and the reports require the formatting of these reports to change monthly as Actual Revenue is reported.
I can accomplish all of these monthly formatting changes based on visible true/false code. However, this code turns reports that were taking 5-7 seconds to open into reports that are taking around 2 minutes to open. (This is of course unacceptable!)
The details: There are 216 fields in the details, header, and footer, 18 of which need to be reset as visible true/false each month. I have it currently set up as 36 Private Subs (three per month, one for each details & header & footer). These are set up as 96, 96, and 24-line codes resembling the following:
Private Sub JanVisibilityDe tails()
Me![JanActuals].Visible = True
Me![JanFinalProj].Visible = True
Me![JanDiffAct].Visible = True
Me![JanDiffPercAct].Visible = True
Me![JanProjC].Visible = False
.....
The Visible True/False setting are listed for each of the 216 fields in each Sub.
These are then called with Case "" statements, such as:
Private Sub Detail_Format(C ancel As Integer, FormatCount As Integer)
Select Case Me![Month]
Case "Jan"
Call JanVisibilityDe tails
Case "Feb"
Call FebVisibilityDe tails
.....
This is all done within the Report Code of each individual report.
I have tried various adjustments, like having the code under each Format Sub case, rather than having each case call a separate Private Sub. Same speed. I changed the report to be looking up a table, and no change to speed. Even just having only the current month's Visible True/False code (without any select case) is still ridiculously slow. So I'm pretty sure it's the 216 lines of formatting code that is slowing everything down, but I'm not sure how to fix this. I'm currently changing visibility by hand in the reports, but I'd really like some kind of automated solution.
I'm a trial-and-error, self-taught user who is still relatively new to VB programming code and DB development. Any help anyone can give me would be very much appreciated.
Thanks!
Carrie
Comment