If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Report not printing correct unless browsing each page
Dear All,
I have a problem in Access Report. I have got a report with nearly 100 pages. If I display it and print it straight away, it is showing me the wrong data. But If I display it and browsing each page, and then print, it works fine. But how can I ask user to browse 100 pages before each time they are print? Any help would be appreciated. Cheers Daniel |
#2
|
|||
|
|||
Report not printing correct unless browsing each page
Do you have code in the report events?
(david) wrote in message ... Dear All, I have a problem in Access Report. I have got a report with nearly 100 pages. If I display it and print it straight away, it is showing me the wrong data. But If I display it and browsing each page, and then print, it works fine. But how can I ask user to browse 100 pages before each time they are print? Any help would be appreciated. Cheers Daniel |
#3
|
|||
|
|||
Report not printing correct unless browsing each page
If you can't fix it any other way, then you might try adding a control
to your report with a control source set to =Pages that will force the report to calculate the number of pages and the only way it can do that is to go all the way through the report to the end. It sounds as if you may be doing calculations in the report's event that changes the data based on more than the current record. This is usually not a reliable method due to the way reports are generated. If the above is true, you might want to post the code and explain what you are attempting to do. '================================================= === John Spencer Access MVP 2002-2005, 2007 Center for Health Program Development and Management University of Maryland Baltimore County '================================================= === david wrote: Do you have code in the report events? (david) wrote in message ... Dear All, I have a problem in Access Report. I have got a report with nearly 100 pages. If I display it and print it straight away, it is showing me the wrong data. But If I display it and browsing each page, and then print, it works fine. But how can I ask user to browse 100 pages before each time they are print? Any help would be appreciated. Cheers Daniel |
#4
|
|||
|
|||
Report not printing correct unless browsing each page
Thanks guys. I do have a lot of code in the report event. Let me try
to explain what I am doing. I have a main report which has 4 sub reports. One of them is the total of the other three. all these four reports are using CrossTab query to show month and year across and some items on the left. In the detail section, there are heaps of textboxes to show the data. In the code, I am using queries which have the criteria of customer to grab data and assign the data into every single textbox. In the datasource of the report, there is just a simple query to have customer name which is used to link with main report. I just paste part of the code in the event to make it clear: Private Sub Report_Open(Cancel As Integer) ..... Set rstExpectedOrderJobs = CurrentDb.OpenRecordset("Select * from qryBudgetExpectedOrderJobs_Joinery Where CompanyName='" & StrCompanyName & "'") ..... End Sub Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) .... For intX = 1 To intColumnCount Me("txtExpectedOrderJobs" & intX) = rstExpectedOrderJobs(intX + 1) NEXT intX .... End Sub I do not know I have explained it clear or not. Can you guys please have a look and give me some suggestion? Thanks heaps. Daniel |
#5
|
|||
|
|||
Report not printing correct unless browsing each page
So this is a sub-report, and it is supposed to grab StrCompanyName
from the main report. How have you done that? (david) wrote in message ... Thanks guys. I do have a lot of code in the report event. Let me try to explain what I am doing. I have a main report which has 4 sub reports. One of them is the total of the other three. all these four reports are using CrossTab query to show month and year across and some items on the left. In the detail section, there are heaps of textboxes to show the data. In the code, I am using queries which have the criteria of customer to grab data and assign the data into every single textbox. In the datasource of the report, there is just a simple query to have customer name which is used to link with main report. I just paste part of the code in the event to make it clear: Private Sub Report_Open(Cancel As Integer) .... Set rstExpectedOrderJobs = CurrentDb.OpenRecordset("Select * from qryBudgetExpectedOrderJobs_Joinery Where CompanyName='" & StrCompanyName & "'") .... End Sub Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) ... For intX = 1 To intColumnCount Me("txtExpectedOrderJobs" & intX) = rstExpectedOrderJobs(intX + 1) NEXT intX ... End Sub I do not know I have explained it clear or not. Can you guys please have a look and give me some suggestion? Thanks heaps. Daniel |
#6
|
|||
|
|||
Report not printing correct unless browsing each page
On Oct 23, 9:45*am, "david" wrote:
So this is a sub-report, and it is supposed to grab StrCompanyName from the main report. *How have you done that? (david) wrote in message ... Thanks guys. I do have a lot of code in the report event. Let me try to explain what I am doing. I have a main report which has 4 sub reports. One of them is the total of the other three. all these four reports are using CrossTab query to show month and year across and some items on the left. In the detail section, there are heaps of textboxes to show the data. In the code, I am using queries which have the criteria of customer to grab data and assign the data into every single textbox. In the datasource of the report, there is just a simple query to have customer name which is used to link with main report. *I just paste part of the code in the event to make it clear: Private Sub Report_Open(Cancel As Integer) .... Set rstExpectedOrderJobs = CurrentDb.OpenRecordset("Select * from qryBudgetExpectedOrderJobs_Joinery Where CompanyName='" & StrCompanyName & "'") .... End Sub Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) ... For intX = 1 To intColumnCount Me("txtExpectedOrderJobs" & intX) = rstExpectedOrderJobs(intX + 1) NEXT intX ... End Sub I do not know I have explained it clear or not. Can you guys please have a look and give me some suggestion? Thanks heaps. Daniel- Hide quoted text - - Show quoted text - That's a text box in main report. I just get the value and use it in the query. Thanks. |
#7
|
|||
|
|||
Report not printing correct unless browsing each page
It appear that is the part which is not working.
You need to delay printing the subreport until after the main report has queried, or re-run the print event after the main report has queried. One way to do that would probably be to put the total number of pages on each page, forcing the report to go through all through the report once to get the number of pages, then a second time to write the total on each page. Another way would be to bind the sub report with a master/child field, even if it is not used, so that the sub report re-queries after the main report gets each page record. (david) wrote in message ... On Oct 23, 9:45 am, "david" wrote: So this is a sub-report, and it is supposed to grab StrCompanyName from the main report. How have you done that? (david) wrote in message ... Thanks guys. I do have a lot of code in the report event. Let me try to explain what I am doing. I have a main report which has 4 sub reports. One of them is the total of the other three. all these four reports are using CrossTab query to show month and year across and some items on the left. In the detail section, there are heaps of textboxes to show the data. In the code, I am using queries which have the criteria of customer to grab data and assign the data into every single textbox. In the datasource of the report, there is just a simple query to have customer name which is used to link with main report. I just paste part of the code in the event to make it clear: Private Sub Report_Open(Cancel As Integer) .... Set rstExpectedOrderJobs = CurrentDb.OpenRecordset("Select * from qryBudgetExpectedOrderJobs_Joinery Where CompanyName='" & StrCompanyName & "'") .... End Sub Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) ... For intX = 1 To intColumnCount Me("txtExpectedOrderJobs" & intX) = rstExpectedOrderJobs(intX + 1) NEXT intX ... End Sub I do not know I have explained it clear or not. Can you guys please have a look and give me some suggestion? Thanks heaps. Daniel- Hide quoted text - - Show quoted text - That's a text box in main report. I just get the value and use it in the query. Thanks. |
#8
|
|||
|
|||
Report not printing correct unless browsing each page
On Oct 24, 8:57*am, "david" wrote:
It appear that is the part which is not working. You need to delay printing the subreport until after the main report has queried, or re-run the print event after the main report has queried. One way to do that would probably be to put the total number of pages on each page, forcing the report to go through all through the report once to get the number of pages, then a second time to write the total on each page. Another way would be to bind the sub report with a master/child field, even if it is not used, so that the sub report re-queries after the main report gets each page record. (david) wrote in message ... On Oct 23, 9:45 am, "david" wrote: So this is a sub-report, and it is supposed to grab StrCompanyName from the main report. How have you done that? (david) wrote in message ... Thanks guys. I do have a lot of code in the report event. Let me try to explain what I am doing. I have a main report which has 4 sub reports. One of them is the total of the other three. all these four reports are using CrossTab query to show month and year across and some items on the left. In the detail section, there are heaps of textboxes to show the data. In the code, I am using queries which have the criteria of customer to grab data and assign the data into every single textbox. In the datasource of the report, there is just a simple query to have customer name which is used to link with main report. I just paste part of the code in the event to make it clear: Private Sub Report_Open(Cancel As Integer) .... Set rstExpectedOrderJobs = CurrentDb.OpenRecordset("Select * from qryBudgetExpectedOrderJobs_Joinery Where CompanyName='" & StrCompanyName & "'") .... End Sub Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) ... For intX = 1 To intColumnCount Me("txtExpectedOrderJobs" & intX) = rstExpectedOrderJobs(intX + 1) NEXT intX ... End Sub I do not know I have explained it clear or not. Can you guys please have a look and give me some suggestion? Thanks heaps. Daniel- Hide quoted text - - Show quoted text - That's a text box in main report. I just get the value and use it in the query. Thanks.- Hide quoted text - - Show quoted text - Thanks David, I do have master/child field linked. I don't understand what you mean about put the total number of pages on each page? can you please explain it a little more? Thanks again. Daniel |
#9
|
|||
|
|||
Report not printing correct unless browsing each page
On Oct 24, 8:57*am, "david" wrote:
It appear that is the part which is not working. You need to delay printing the subreport until after the mainreporthas queried, or re-run the print event after the mainreporthas queried. One way to do that would probably be to put the total number of pages on each page, forcing thereportto go through all through thereportonce to get the number of pages, then a second time to write the total on each page. Another way would be to bind the subreportwith a master/child field, even if it is not used, so that the subreportre-queries after the mainreportgets each page record. (david) wrote in message ... On Oct 23, 9:45 am, "david" wrote: So this is a sub-report, and it is supposed to grab StrCompanyName from the mainreport. How have you done that? (david) wrote in message ... Thanks guys. I do have a lot of code in thereportevent. Let me try to explain what I am doing. I have a mainreportwhich has 4 sub reports. One of them is the total of the other three. all these four reports are using CrossTab query to show month and year across and some items on the left. In the detail section, there are heaps of textboxes to show the data. In the code, I am using queries which have the criteria of customer to grab data and assign the data into every single textbox. In the datasource of the report, there is just a simple query to have customer name which is used to link with mainreport. I just paste part of the code in the event to make it clear: Private Sub Report_Open(Cancel As Integer) .... Set rstExpectedOrderJobs = CurrentDb.OpenRecordset("Select * from qryBudgetExpectedOrderJobs_Joinery Where CompanyName='" & StrCompanyName & "'") .... End Sub Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) ... For intX = 1 To intColumnCount Me("txtExpectedOrderJobs" & intX) = rstExpectedOrderJobs(intX + 1) NEXT intX ... End Sub I do not know I have explained it clear or not. Can you guys please have a look and give me some suggestion? Thanks heaps. Daniel- Hide quoted text - - Show quoted text - That's a text box in mainreport. I just get the value and use it in the query. Thanks.- Hide quoted text - - Show quoted text - Thanks David, I do have master/child field linked. But what do you mean "Put the total number of pages on each pate"? Can you please explain a little bit more? I have got total pates field in the page footer section. Thanks again. Daniel |
#10
|
|||
|
|||
Report not printing correct unless browsing each page
That's =Pages as the source for a text box, as John Spencer suggested.
If you've got that, and a master/child field then "it should be working" :~( Do you display the value of StrCompanyName on the sub-report? Does it display correctly? Also display the PrintCount value from the detail section. Just to be clear, the wrong values that you see are shown in the detail section of a subreport? Do you know how to modify a cross-tab query to get fixed field names? Can you do it that way? (david) wrote in message ... On Oct 24, 8:57 am, "david" wrote: It appear that is the part which is not working. You need to delay printing the subreport until after the main report has queried, or re-run the print event after the main report has queried. One way to do that would probably be to put the total number of pages on each page, forcing the report to go through all through the report once to get the number of pages, then a second time to write the total on each page. Another way would be to bind the sub report with a master/child field, even if it is not used, so that the sub report re-queries after the main report gets each page record. (david) wrote in message ... On Oct 23, 9:45 am, "david" wrote: So this is a sub-report, and it is supposed to grab StrCompanyName from the main report. How have you done that? (david) wrote in message ... Thanks guys. I do have a lot of code in the report event. Let me try to explain what I am doing. I have a main report which has 4 sub reports. One of them is the total of the other three. all these four reports are using CrossTab query to show month and year across and some items on the left. In the detail section, there are heaps of textboxes to show the data. In the code, I am using queries which have the criteria of customer to grab data and assign the data into every single textbox. In the datasource of the report, there is just a simple query to have customer name which is used to link with main report. I just paste part of the code in the event to make it clear: Private Sub Report_Open(Cancel As Integer) .... Set rstExpectedOrderJobs = CurrentDb.OpenRecordset("Select * from qryBudgetExpectedOrderJobs_Joinery Where CompanyName='" & StrCompanyName & "'") .... End Sub Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) ... For intX = 1 To intColumnCount Me("txtExpectedOrderJobs" & intX) = rstExpectedOrderJobs(intX + 1) NEXT intX ... End Sub I do not know I have explained it clear or not. Can you guys please have a look and give me some suggestion? Thanks heaps. Daniel- Hide quoted text - - Show quoted text - That's a text box in main report. I just get the value and use it in the query. Thanks.- Hide quoted text - - Show quoted text - Thanks David, I do have master/child field linked. I don't understand what you mean about put the total number of pages on each page? can you please explain it a little more? Thanks again. Daniel |
Thread Tools | |
Display Modes | |
|
|