按过滤器打印报告

按过滤器打印报告

本文介绍了按过滤器打印报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在尝试根据我输入的

文本框中的ID号来打印报告,但它只是打印表中的所有记录:(


Dim stDocName As String

Dim strWhere as String


strWhere =" ; [ID] ="& Me。[txtOrderID]


stDocName =" rptLabelsWDM_single"

DoCmd.OpenReport stDocName,acNormal


txtOrderID.SetFocus


谢谢,


-


亲切的问候,

客户服务

PS为了让我们有效地回复您的电子邮件,请始终包含

原始邮件。谢谢。

Hi,

I am trying to get a report to print based on what ID number I type into a
text box, but it just prints all records in the table :(

Dim stDocName As String
Dim strWhere As String

strWhere = "[ID] = " & Me.[txtOrderID]

stDocName = "rptLabelsWDM_single"
DoCmd.OpenReport stDocName, acNormal

txtOrderID.SetFocus

Thank You,

--

Kind Regards,
Customer Services
P.S. For us to answer your emails efficiently, please always include the
original message. Thank you.

推荐答案






strWhere是过滤记录的where子句,但是你永远不会将
添加到where子句参数位置。


DoCmd.OpenReport stDocName,acNormal ,, strWhere


-

Fred

请只回复此新闻组。

我不回复个人电子邮件。



strWhere is the where clause to filter the records, but you never
added it to the where clause argument position.

DoCmd.OpenReport stDocName, acNormal, ,strWhere

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.


这篇关于按过滤器打印报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 14:17