打印单个记录的详细信息(即报告) [英] Printing a detail of a single record (ie report)

查看:98
本文介绍了打印单个记录的详细信息(即报告)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是MS Access的新手,所以请耐心等待。我正在尝试创建一个

报表格式并将一个按钮附加到表单。这将是用户打印出他们正在查看的记录。我可以报告一个打印出整个数据库的报告

所以如何限制它只是用户在屏幕上看到的

记录?


感谢您的提示。

I am new to MS Access so please bear with me. I am trying to create a
report format and attach a button to a form. This would users to
print-out a record that they are looking at. I can report a report
which print out the entire database so how do I limit it do just the
record that the user see on screen?

Thanks for the tip.

推荐答案

Fendi:


在表单按钮的VB代码中,找到打开

报表的行,然后像这样更改(全部一行):


DoCmd。 OpenReport stDocName,acPreview ,,把你的标准放在这里=

&我!FieldName


替换在此放置您的标准使用您的报告标准

来限制返回的记录,例如[RecordID] =我!RecordID。

Criteria部分基本上是一个where子句,没有单词

WHERE。


HTH,
Jana

Fendi:

In the VB code for your form button, find the line that opens your
report, and change it like this (all one line):

DoCmd.OpenReport stDocName, acPreview,,"Put Your Criteria Here ="
& Me!FieldName

Replace the "Put Your Criteria Here" with the criteria for your report
to limit the records returned, such as "[RecordID] = " Me!RecordID.
The Criteria portion is basically a where clause without the word
WHERE.

HTH,
Jana




Jana写道:

Jana wrote:
Fendi:

在表单按钮的VB代码中,找到打开
报告的行,并将其更改为(所有一行):

DoCmd.OpenReport stDocName,acPreview ,,把你的标准放在这里="
&我!FieldName

替换在此放置您的标准根据您的报告标准
限制返回的记录,例如[RecordID] =我!RecordID。
Criteria部分基本上是一个where子句,没有单词
WHERE。

HTH,
Jana
Fendi:

In the VB code for your form button, find the line that opens your
report, and change it like this (all one line):

DoCmd.OpenReport stDocName, acPreview,,"Put Your Criteria Here ="
& Me!FieldName

Replace the "Put Your Criteria Here" with the criteria for your report
to limit the records returned, such as "[RecordID] = " Me!RecordID.
The Criteria portion is basically a where clause without the word
WHERE.

HTH,
Jana




谢谢Jana。我会试一试。



Thank you Jana. I''ll give it a go.


Jana


我试过这个但不知何故我没有得到正确的结果。


Dim stDocName As String

stDocName =" dbo_School查询"

DoCmd.OpenReport stDocName,acPreview, ,[SchoolID] =我!SchoolID,

acDialog


我尝试了不同的schoolID组合甚至硬编码

我!SchoolID但结果仍然相同,报告为我的数据库中的所有学校生成了




我是否需要对报告做任何事情格式本身?


问候

Jana

I tried this and somehow I am not getting the right result.

Dim stDocName As String
stDocName = "dbo_School Query"
DoCmd.OpenReport stDocName, acPreview, , [SchoolID] = Me!SchoolID,
acDialog

I tried diffent combination of schoolID and even hard coding the
Me!SchoolID but the result is still the same, the report generates for
all the schools in my database.

Do I need to do anything to the report format itself?

Regards


这篇关于打印单个记录的详细信息(即报告)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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