报表在打印预览时运行代码 [英] Report runs code when print previewing

查看:122
本文介绍了报表在打印预览时运行代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我打开某个报告时,会运行一些代码,生成将在该报告中显示的记录

。这很好用。当我去打印

预览报告时,似乎代码再次运行?这导致

某些错误问题。


1当报告已经存在

时,为什么代码会运行打印预览?


2我在代码中使用什么命令来查明报告(或任何其他

对象)是否已经打开/加载?


谢谢


Gord

解决方案

Gord,


你的意思是什么?报告已经存在?如果你无法在

打印预览中看到它,它就不存在了。如果您之前打印过它,它打印

并关闭。


Bonnie
http://www.dataplus-svc.com

Gord写道:
< blockquote class =post_quotes>
>当我打开某个报告时,它会运行一些代码来生成将在该报告中显示的记录。这很好用。当我去打印
预览报告时,似乎代码再次运行?这导致了某些错误问题。

1当报告已存在时,为什么代码会运行打印预览?

2什么命令我是否在代码中使用以查明报告(或任何其他对象)是否已经打开/加载?

谢谢

Gord



-

通过 http://www.accessmonster.com


我从导航窗格中打开报告,看到它在报告视图中。报告中显示的

记录来自我编写的代码,显示为

就好了。在这一点上,我将报告称为b $ b''现有''。进入报表视图后,当我单击打印预览时,它将显示

我的代码再次运行。 (不明白为什么?)当代码运行时

会产生一些错误,因为报告已经打开(存在)。


谢谢,


Gord

" bhicks11 via AccessMonster.com" < u44327 @ uwewrote in message

news:88179f7fcbbd9 @ uwe ...


Gord,


报告已经存在?是什么意思?如果你无法在

打印预览中看到它,它就不存在了。如果您之前打印过它,它打印

并关闭。


Bonnie
http://www.dataplus-svc.com

Gord写道:
< blockquote class =post_quotes>
>>当我打开某个报告时,它会运行一些代码来生成将在该报告中显示的记录。这很好用。当我去
打印
预览报告时,似乎代码再次运行?这导致了某些错误问题。

1当报告已存在时,为什么代码会运行打印预览?

2什么命令我是否在代码中使用以查明报告(或任何其他对象)是否已经打开/加载?

谢谢

Gord



-

通过 http://www.accessmonster.com



也许我错过了一些东西(很有可能) !)。你是从文件 - 打印预览中打印预览吗?当你打开它时,你处于预览模式的第一个

时间。顺便说一下,我在Access 2003中。你在2007年是否需要



Bonnie
http://www.dataplus-svc.com


>我从导航窗格中打开报告,并在报告视图中查看。报告中显示的
记录来自我编写的代码,并且显示得很好。在这一点上,我将报告称为现有。进入报表视图后,当我点击打印预览时,会出现
我的代码再次运行。 (不明白为什么?)当代码运行时
会产生一些错误,因为报告已经打开(存在)。

谢谢,

<


> Gord,


[引用文字剪辑 - 20行]


>>>
Gord



-

通过AccessMonster.com发布的消息
http://www.accessmonster.com/Uwe/For...ccess/200808/1


When I open a certain report, it runs some code that generates the records
that will be displayed in that report. This works fine. When I go to print
preview the report it appears that the code is run again? This is causing
certain error problems.

1 Why does the code run for a print preview when the report already
exists?

2 What command do I use in code to find out if a report (or any other
object for that matter) is already open/loaded?

Thanks

Gord

解决方案

Gord,

What do you mean by "the report already exists?" If you can''t see it in
print preview, it doesn''t exist. If you have printed it before, it prints
and closes.

Bonnie
http://www.dataplus-svc.com

Gord wrote:

>When I open a certain report, it runs some code that generates the records
that will be displayed in that report. This works fine. When I go to print
preview the report it appears that the code is run again? This is causing
certain error problems.

1 Why does the code run for a print preview when the report already
exists?

2 What command do I use in code to find out if a report (or any other
object for that matter) is already open/loaded?

Thanks

Gord

--
Message posted via http://www.accessmonster.com


I ''open'' the report from the navigation pane and see it in report view. The
records shown in the report are derived from the code I have written and are
displayed just fine. It is at this point I refer to the report as
''existing''. Once in report view, when I click print preview it would appear
my code is run again. (don''t understand why?). When the code runs it
creates some errors because the report is already open (exists).

Thanks,

Gord
"bhicks11 via AccessMonster.com" <u44327@uwewrote in message
news:88179f7fcbbd9@uwe...

Gord,

What do you mean by "the report already exists?" If you can''t see it in
print preview, it doesn''t exist. If you have printed it before, it prints
and closes.

Bonnie
http://www.dataplus-svc.com

Gord wrote:

>>When I open a certain report, it runs some code that generates the records
that will be displayed in that report. This works fine. When I go to
print
preview the report it appears that the code is run again? This is causing
certain error problems.

1 Why does the code run for a print preview when the report already
exists?

2 What command do I use in code to find out if a report (or any other
object for that matter) is already open/loaded?

Thanks

Gord


--
Message posted via http://www.accessmonster.com



Maybe I am missing something Gord (which is highly possible!). Are you
hitting print preview from File - Print Preview? When you open it the first
time you are in Preview mode. By the way, I am in Access 2003. Are you in
2007?

Bonnie
http://www.dataplus-svc.com

Gord wrote:

>I ''open'' the report from the navigation pane and see it in report view. The
records shown in the report are derived from the code I have written and are
displayed just fine. It is at this point I refer to the report as
''existing''. Once in report view, when I click print preview it would appear
my code is run again. (don''t understand why?). When the code runs it
creates some errors because the report is already open (exists).

Thanks,

Gord

>Gord,

[quoted text clipped - 20 lines]

>>>
Gord

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200808/1


这篇关于报表在打印预览时运行代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆