打印报告3次,可见3个不同的字段 [英] Print a report 3 times with 3 different fields visible

查看:78
本文介绍了打印报告3次,可见3个不同的字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有报告我需要打印3次,但是希望以下标题




客户复印 - 打印1

帐户复印 - 打印2

文件复制 - 打印3


我创建了一个宏来打印报告三次,但不知道如何

我可以显示每个打印的每个文本字段。


任何人都可以指出我正确的方向。

Hi,

I have report which I need to print 3 times, but would like to have
the following headings

Customer Copy - Print 1
Accounts Copy - Print 2
File Copy -Print 3

I created a macro to print the report three times, but do not know how
I can display each text field for each print.

Can anybody point me in the right direction.

推荐答案

Studiotyphoon写道:
Studiotyphoon wrote:




我有报告我需要打印3次,但想要以下标题




客户复印 - 打印1

帐户复印 - 打印2

文件复制 - 打印3


我创建了一个宏来打印报告三次,但不知道如何

我可以显示每个打印的每个文本字段。


任何人都能指出我的正确方向灰。
Hi,

I have report which I need to print 3 times, but would like to have
the following headings

Customer Copy - Print 1
Accounts Copy - Print 2
File Copy -Print 3

I created a macro to print the report three times, but do not know how
I can display each text field for each print.

Can anybody point me in the right direction.



您使用的是什么版本的Access?有一个OpenArgs参数

你可以传递给A2003中的报告。例如:

DoCmd.OpenReport" YourReportName",,,,," 1"

DoCmd.OpenReport" YourReportName",,,,," 2"

DoCmd.OpenReport" YourReportName",,,,," 3"


1,2,3是参数。我创建了一个名为Report1的报告。我

创建了2个文本框; Text1和Text2。我把Text1放在报告'

标题中,可见= False。我把Text2放在报告页脚中。


在Text1中输入,对于Data选项卡中的ControlSource,

= NZ([Reports]![Report1] ]。[OpenArgs],0)

因为Report1是报告的名称。


在Text2中我输入了

= IIf([Text1] =" 1"," Customer",IIf([Text1] =" 2"," Account"," File"))& "在控制源中复制



现在,当我运行报告时,根据传递的参数,它会打印

我想要的价值。


Fireballs
http://www.youtube.com/watch?v=uzkNI4YIU2o


4月19日,8:51 * pm,Salad< ; o ... @ vinegar.comwrote:
On Apr 19, 8:51*pm, Salad <o...@vinegar.comwrote:

Studiotyphoon写道:
Studiotyphoon wrote:


Hi,


我有报告我需要打印3次,但是希望

以下标题
I have report which I need to print 3 times, but would like to have
the following headings


客户复印 - 打印1

帐户复印 - 打印2

文件复制 - 打印3
Customer Copy - Print 1
Accounts Copy - Print 2
File Copy -Print 3


我创建了一个宏来打印报告三次,但不知道怎么回事

我可以显示每个打印的每个文本字段。
I created a macro to print the report three times, but do not know how
I can display each text field for each print.


任何人都能指出我正确的方向。
Can anybody point me in the right direction.



你使用什么版本的Access? *有一个OpenArgs参数

你可以传递给A2003中的报告。 *例如:

* * * * DoCmd.OpenReport" YourReportName",,,,," 1"

* * * * DoCmd.OpenReport" YourReportName" ,,,,," 2"

* * * * DoCmd.OpenReport" YourReportName",,,,," 3"


1,2,3是争论。 *我创建了一个名为Report1的报告。 *我

创建了2个文本框; Text1和Text2。 *我将Text1放在报告'

标题中,可见= False。 *我将Text2放在报告页脚中。


在Text1中输入,对于Data选项卡中的ControlSource,

* * * * = NZ([报告]![Report1]。[OpenArgs],0)

因为Report1是报告的名称。


在Text2中我输入

* * * * = IIf([Text1] =" 1"," Customer",IIf([Text1] =" 2"," Account"," File")) &安培; "复制和QUOT; * * * *

在控制源中。


现在当我运行报告时,根据传递的参数,它打印

我想要的价值。


Fireballshttp://www.youtube.com/watch?v = uzkNI4YIU2o


What version of Access are you using? *There is an OpenArgs parameter
you can pass to the report in A2003. *Ex:
* * * * DoCmd.OpenReport "YourReportName", , , , , "1"
* * * * DoCmd.OpenReport "YourReportName", , , , , "2"
* * * * DoCmd.OpenReport "YourReportName", , , , , "3"

The 1,2,3 is the argument. *I created a report called Report1. *I
created 2 text boxes; Text1 and Text2. *I put Text1 in the report''s
header, visible = False. *I put Text2 in the Report footer.

In Text1 I entered, for the ControlSource in the Data tab,
* * * * =NZ([Reports]![Report1].[OpenArgs],"0")
as Report1 is the name of the report.

In Text2 I entered
* * * * =IIf([Text1]="1","Customer",IIf([Text1]="2","Account","File")) & " Copy" * * * *
in the control source.

Now when I run the report, depending on the argument passed, it prints
the value I want.

Fireballshttp://www.youtube.com/watch?v=uzkNI4YIU2o



到目前为止,感谢您的帮助。


运行Access 2003,SP2



我在On Open Event下的报告中添加了以下内容

Thanks for help so far.

Running Access 2003, SP2

But still struggling to get it to work.

I''ve added the following into the report under On Open Event


DoCmd.OpenReport" YourReportName",,,,," 1"

DoCmd.OpenReport" YourReportName",,,,," 2"

DoCmd.OpenReport" YourReportName",,,,," 3"
DoCmd.OpenReport "YourReportName", , , , , "1"
DoCmd.OpenReport "YourReportName", , , , , "2"
DoCmd.OpenReport "YourReportName", , , , , "3"



当我尝试运行报告时,它会对代码的第一行

出现错误。


此代码是否应该在报告或表格中供OpenArgs使用。


另请参阅我的回复,直接发送到您的电子邮箱。

提前致谢 -

When I try running the report it comes up with an error against the
first line of the code.

Should this code be in the report or Form for the OpenArgs to be used.

Also see my reply direct to your email.

Thanks in advance -


Studiotyphoon写道:
Studiotyphoon wrote:

4月19日,8:51 pm,Salad< o ... @ vinegar.comwrote:
On Apr 19, 8:51 pm, Salad <o...@vinegar.comwrote:

>> Studiotyphoon写道:
>>Studiotyphoon wrote:

>>>
>>>Hi,


>>>我有报告我需要打印3次,但希望有以下标题
>>>I have report which I need to print 3 times, but would like to have
the following headings


>>>客户复印 - 打印1
账户复制 - 打印2
文件复制 - 打印3
>>>Customer Copy - Print 1
Accounts Copy - Print 2
File Copy -Print 3


>>>我创建了一个宏来打印报告三次,但不知道如何显示每个打印的每个文本字段。
>>>I created a macro to print the report three times, but do not know how
I can display each text field for each print.


>>>任何人都能指出我正确的方向。
>>>Can anybody point me in the right direction.


您使用的Access版本是什么?有一个OpenArgs参数
您可以传递给A2003中的报告。例如:
DoCmd.OpenReport" YourReportName",,,,," 1"
DoCmd.OpenReport" YourReportName",,,,," 2"
DoCmd.OpenReport" ; YourReportName",,,,," 3"

1,2,3是参数。我创建了一个名为Report1的报告。我创建了2个文本框; Text1和Text2。我把Text1放在报告的
标题中,可见= False。我把Text2放在报告页脚中。

在Text1中输入,对于Data选项卡中的ControlSource,
= NZ([Reports]![Report1]。[OpenArgs]," 0)
因为Report1是报告的名称。

在Text2中我输入了
= IIf([Text1] =" 1",Customer,IIf ([Text1] =" 2"," Account"," File"))& "复制
在控制源中。

现在,当我运行报告时,根据传递的参数,它会打印出我想要的值。
Fireballshttp://www.youtube.com/watch?v = uzkNI4YIU2o


What version of Access are you using? There is an OpenArgs parameter
you can pass to the report in A2003. Ex:
DoCmd.OpenReport "YourReportName", , , , , "1"
DoCmd.OpenReport "YourReportName", , , , , "2"
DoCmd.OpenReport "YourReportName", , , , , "3"

The 1,2,3 is the argument. I created a report called Report1. I
created 2 text boxes; Text1 and Text2. I put Text1 in the report''s
header, visible = False. I put Text2 in the Report footer.

In Text1 I entered, for the ControlSource in the Data tab,
=NZ([Reports]![Report1].[OpenArgs],"0")
as Report1 is the name of the report.

In Text2 I entered
=IIf([Text1]="1","Customer",IIf([Text1]="2","Account","File")) & " Copy"
in the control source.

Now when I run the report, depending on the argument passed, it prints
the value I want.

Fireballshttp://www.youtube.com/watch?v=uzkNI4YIU2o




到目前为止感谢您的帮助。


运行Access 2003,SP2

但是仍然很难让它工作。


我已经将以下内容添加到On Open Event下的报告



Thanks for help so far.

Running Access 2003, SP2

But still struggling to get it to work.

I''ve added the following into the report under On Open Event


> DoCmd.OpenReport" YourReportName",,,,," 1"
DoCmd.OpenReport" YourReportName",,,,," 2"
DoCmd.OpenReport" YourReportName" ,,, ,3,
> DoCmd.OpenReport "YourReportName", , , , , "1"
DoCmd.OpenReport "YourReportName", , , , , "2"
DoCmd.OpenReport "YourReportName", , , , , "3"




当我尝试运行报告时,它会在代码的第一行

出现错误。



When I try running the report it comes up with an error against the
first line of the code.



我不使用宏。我检查了Macro构建器,它们没有OpenArgs

的功能。我想你可以使用RunCode并在代码中使用
模块将OpenReport行放在sub中。


你改变了YourReportName吗?到报告的名称?

I don''t use macros. I checked the Macro builder and there''s no OpenArgs
capability with them. I suppose you could use RunCode and in a code
module put the OpenReport lines in the sub.

Did you change "YourReportName" to the name of your report?


此代码是否应在报告或表单中供OpenArgs使用。
Should this code be in the report or Form for the OpenArgs to be used.



通常我会从表单中调用报表。我可能有一个命令按钮

CommandReport,标题为Report。在OnClick事件中,我将

有这3行。我不会在报告的模块中有它们。

Usually I call reports from a form. I might have a command button
CommandReport with a caption of "Report". In the OnClick event I would
have those 3 lines. I would not have them in the Report''s module.


>

另请参阅我的回复,直接发送到您的电子邮箱。
>
Also see my reply direct to your email.



我不认为它成功了。 Sald可能与油和醋混合,但据我所知,还有

不是这样的电子邮件地址。


请记住,我创建了一个文本框报告标题带。我有

= NZ([报告]![报告1]。[OpenArgs],0)

作为控制源(在属性表的数据标签下) 。您需要

将Report1更改为您的报告名称。

在页脚区域,我在底部放置另一个文本框来打印消息。

= IIf([Text1] =" 1"," Customer",IIf([Text1] =" 2"," Account"," File"))

您需要将Text1更改为Report标题中Textbox的名称。

I don''t think it made it. Sald may mix with oil and vinegar but there''s
not such email address as far as I know.

Remember, I created a text box in the Report header band. I have
=NZ([Reports]![Report1].[OpenArgs],"0")
as the Control source (under data tab of property sheet). You need to
change Report1 to your report''s name.
In the footer band I put another textbox at the bottom to print the message.
=IIf([Text1]="1","Customer",IIf([Text1]="2","Account","File"))
You need to change Text1 to the name of the Textbox in the Report header.


>

提前致谢 -
>
Thanks in advance -



这是你可以做的另一件事。忘记第一个文本框...将页脚的

第二个文本框放在页脚上。现在打开报告的代码模块

并将此代码放入其中。


私有函数GetCopyText()As String

''如果没有参数传递默认为'File'。如有必要,请在新西兰单词上按F1

''

选择Case NZ(Me.OpenArgs,3)

案例1

GetCopyText =" Customer"

Case 2

GetCopyText =" Accounts"

Case Else
GetCopyText =" File"

End Select

GetCopyText = GetCopyText& "复制 - 打印

GetCopyText = GetCopyText&新西兰(Me.OpenArgs,3)

结束功能


现在在报告页面页脚的文本框的ControlSource中输入

= GetCopyText()

这将调用函数GetCopyText并将结果打印在页脚中。


无论哪种方式都有效。


感觉良好
http://www.youtube.com/watch?v=xA4lPE4MI6A&NR=1


这篇关于打印报告3次,可见3个不同的字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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