Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / September 2007

Tip: Looking for answers? Try searching our database.

Print Report Code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
2005sporty - 12 Sep 2007 13:48 GMT
I have a report with code that runs several commands that genaertas data for
the report on activate. I have a preview set on this report and the code is
run when preview is clicked. When preview is printed the code is re-run and
the improper data is displayed. I would like to preview the report and run
the code and then print the report with out running the code again. Any
advise would be greatly appreciated...
Pat Hartman (MVP) - 12 Sep 2007 13:55 GMT
The code is run a second time because the data may have changed between when
you previewed it and when you printed it.  To have the code run only once,
you need to go directly to print rather than opening the report in preview
first.

>I have a report with code that runs several commands that genaertas data
>for
[quoted text clipped - 5 lines]
> the code and then print the report with out running the code again. Any
> advise would be greatly appreciated...
2005sporty - 12 Sep 2007 14:26 GMT
Thanks for the input.
The data does not get changed the user plugs in values to view the report.
The preview allows the user to validate values on screen then print the
report. As it is now I have a preview then a print button that prints the
screen no problem. Unfortunatley the user wants to print directly from what
they see on the screen. When the report is printed it reruns the code within
the report and changes the input values. I need to figure out to stop the
code from running a second time, and just print what is there.

> The code is run a second time because the data may have changed between when
> you previewed it and when you printed it.  To have the code run only once,
[quoted text clipped - 10 lines]
> > the code and then print the report with out running the code again. Any
> > advise would be greatly appreciated...
fredg - 12 Sep 2007 15:31 GMT
> Thanks for the input.
> The data does not get changed the user plugs in values to view the report.
[quoted text clipped - 19 lines]
>>> the code and then print the report with out running the code again. Any
>>> advise would be greatly appreciated...

If you want a specific answer you have to provide specific
information.
What is the code?. Where is it placed?
What is the Preview data?
What is the data when printed?
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

2005sporty - 12 Sep 2007 19:14 GMT
The code is a series of steps that calculates costs and budgets and year
allocated. I did not write it.The preview data is a report that gets
generated from the data calculated by the code. The data when printed is the
report. The code is based in a report and runs everytime it is previewed or
printed. The issue is the print preview report is the correct data, when it
is printed the code gets re-run and the data is incorrect, not the data in
the print preview.
> If you want a specific answer you have to provide specific
> information.
> What is the code?. Where is it placed?
> What is the Preview data?
> What is the data when printed?
fredg - 12 Sep 2007 21:46 GMT
> The code is a series of steps that calculates costs and budgets and year
> allocated. I did not write it.The preview data is a report that gets
[quoted text clipped - 8 lines]
>> What is the Preview data?
>> What is the data when printed?

It's like pulling teeth.
You just are not going to offer any constructive information.
Where (in what event) is this code placed?
What is the actual data supposed to be when Previewed?
What is the actual data when printed?

Is the printed data double the Preview value?

The data is computed when previewed then computed again when printed.

If so, I would guess that you have not re-set your controls value to 0
in the report Header Format event.

That's the best I can offer you on what you have posted.

Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

2005sporty - 12 Sep 2007 22:00 GMT
It looks as if you are correct I found one other person having this issue.
Here is what I am looking at

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)

End Sub

> > The code is a series of steps that calculates costs and budgets and year
> > allocated. I did not write it.The preview data is a report that gets
[quoted text clipped - 23 lines]
>
> That's the best I can offer you on what you have posted.
Pat Hartman (MVP) - 13 Sep 2007 14:06 GMT
You cannot stop Access from recreating the report so if it is your code that
is causing the problem, you will need to modify the code so that it doesn't
come up with different values the second time it is run.  As fredg as
suggested a couple of times, posting the code will likely get you a more
precise answer.

> Thanks for the input.
> The data does not get changed the user plugs in values to view the report.
[quoted text clipped - 26 lines]
>> > the code and then print the report with out running the code again. Any
>> > advise would be greatly appreciated...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.