golfinholic
New member
- Local time
- Tomorrow, 07:55
- Joined
- Jun 11, 2008
- Messages
- 7
Hi all,
New to here, new to access too. I only seriously develop stuff in Access since less than 2 weeks ago.
One of the report I have developed (its on live now) is PAINFULLY slow. So I want better solution with it. Its not super urgent but would be nice if I can improve it ASAP.
Requirement:
A customer requires a Access Report to print their invoice. BUT depends on the value in a piece of record, it can output 3 completely different layout. The invoices has to output in a specific order by order number etc. Both 3 type of report can use same query.
Currently:
I have created a MainReport and 3 x subReport (subrptFormat1, subrptFormat2 and subrptFormat3) inside it. Long story short the main report using a query (select * from tblInvoice order by invoiceID). The main form also has 2 x textboxes which will be popluated with value of "InvoiceID" and "Type"
3 x subreport will populate by query (select * from tblInvoice where InvoiceID = [Reports]![MainReport]![txtInvoiceID]).
At the same time, the main report will hide 2 of 3 subreports depends on the "Type" value of the record. In the VBA I do the following in the main report:
if [Type].value = 1 then
Me.subrptFormat1.Visible = true
Me.subrptFormat2.Visible = false
Me.subrptFormat3.Visible = false
elseif [Type].value = 2 then
Me.subrptFormat1.Visible = false
Me.subrptFormat2.Visible = true
Me.subrptFormat3.Visible = false
else
Me.subrptFormat1.Visible = false
Me.subrptFormat2.Visible = false
Me.subrptFormat3.Visible = true
endif
End Result:
So I have all these different format reports, consume the same query can able to keep the order I want, in ONE report window.
-----------------------------------------------------------
But as you can see its PAINFULLY slow. Generally speaking for EVERY record it needs to go thru the MainReport, then each of the subreport, then hide the other 2 subreports is not using at this particular page.
I thought there would be something I can "Programatically suppress" the 2 subreports I don't use for a particular page to run with condition on the "Type" value but I found nothing useful.
I also thought of creating just 1 x report with all the dynamic formating stuff in there (Control.Visible = true/false) but maintainence would be a nightmare PLUS adding another report format into it will become almost mission impossible.
Can anyone provide me a better solution to do what I am doing?
Thanks in advance
p.s. Some more background info:
The query can return 60,000 rows worth of records.
New to here, new to access too. I only seriously develop stuff in Access since less than 2 weeks ago.
One of the report I have developed (its on live now) is PAINFULLY slow. So I want better solution with it. Its not super urgent but would be nice if I can improve it ASAP.
Requirement:
A customer requires a Access Report to print their invoice. BUT depends on the value in a piece of record, it can output 3 completely different layout. The invoices has to output in a specific order by order number etc. Both 3 type of report can use same query.
Currently:
I have created a MainReport and 3 x subReport (subrptFormat1, subrptFormat2 and subrptFormat3) inside it. Long story short the main report using a query (select * from tblInvoice order by invoiceID). The main form also has 2 x textboxes which will be popluated with value of "InvoiceID" and "Type"
3 x subreport will populate by query (select * from tblInvoice where InvoiceID = [Reports]![MainReport]![txtInvoiceID]).
At the same time, the main report will hide 2 of 3 subreports depends on the "Type" value of the record. In the VBA I do the following in the main report:
if [Type].value = 1 then
Me.subrptFormat1.Visible = true
Me.subrptFormat2.Visible = false
Me.subrptFormat3.Visible = false
elseif [Type].value = 2 then
Me.subrptFormat1.Visible = false
Me.subrptFormat2.Visible = true
Me.subrptFormat3.Visible = false
else
Me.subrptFormat1.Visible = false
Me.subrptFormat2.Visible = false
Me.subrptFormat3.Visible = true
endif
End Result:
So I have all these different format reports, consume the same query can able to keep the order I want, in ONE report window.
-----------------------------------------------------------
But as you can see its PAINFULLY slow. Generally speaking for EVERY record it needs to go thru the MainReport, then each of the subreport, then hide the other 2 subreports is not using at this particular page.
I thought there would be something I can "Programatically suppress" the 2 subreports I don't use for a particular page to run with condition on the "Type" value but I found nothing useful.
I also thought of creating just 1 x report with all the dynamic formating stuff in there (Control.Visible = true/false) but maintainence would be a nightmare PLUS adding another report format into it will become almost mission impossible.
Can anyone provide me a better solution to do what I am doing?
Thanks in advance
p.s. Some more background info:
The query can return 60,000 rows worth of records.