使用一个报告进行不同的查询 [英] Using one report for different queries

查看:61
本文介绍了使用一个报告进行不同的查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有打印信封的报告。该报告基于查询。现在我需要再做10个查询来进行不同的地址选择。

每个查询都有与现有查询相同的输出字段。我知道

我可以复制报告并将其基于另一个查询,但之后我将不得不另外报告
。我如何只为所有查询使用一个报告?

目前我在表单中使用按钮向导来制作按钮,以启动

特定报告。结果代码如下所示:


Private Sub Knop34_Click()

On Error GoTo Err_Knop29_Click


Dim stDocName As字符串


stDocName =" Alle leden per Bezorgcategorie"

DoCmd.OpenReport stDocName,acPreview


Exit_Knop29_Click:

退出子


我是否可以添加一些代码来查询报告应该是什么?b $ b基于?

谢谢,

john

I have a report to print envelopes. The report is based on a query. Now I
need to make 10 more queries to make different selections of addresses.
Every query has the same output fields as the already existing query. I know
I can copy the report and base it on another query but then I would have to
make 10 extra reports. How can I use just one report for all of the queries?
At the moment I use the button wizard in my forms to make buttons that start
the particular reports. Resulting code looks like this:

Private Sub Knop34_Click()
On Error GoTo Err_Knop29_Click

Dim stDocName As String

stDocName = "Alle leden per Bezorgcategorie"
DoCmd.OpenReport stDocName, acPreview

Exit_Knop29_Click:
Exit Sub

Can I perhaps add some code that points which query the report should be
based on?
Thanks,
john

推荐答案

您的10个查询有何不同?在我看来像你一样

应该能够通过一个查询,一个报告以及

或者过滤器完成所有这些操作。


john写道:
What is different about your 10 queries? It seems to me like you
should be able to do all of this with one query, one report, and
perhaps a filter.

john wrote:

我有打印信封的报告。该报告基于查询。现在我需要再做10个查询来进行不同的地址选择。

每个查询都有与现有查询相同的输出字段。我知道

我可以复制报告并将其基于另一个查询,但之后我将不得不另外报告
。我如何只为所有查询使用一个报告?

目前我在表单中使用按钮向导来制作按钮,以启动

特定报告。结果代码如下所示:


Private Sub Knop34_Click()

On Error GoTo Err_Knop29_Click


Dim stDocName As字符串


stDocName =" Alle leden per Bezorgcategorie"

DoCmd.OpenReport stDocName,acPreview


Exit_Knop29_Click:

退出子


我是否可以添加一些代码来查询报告应该是什么?b $ b基于?

谢谢,

john
I have a report to print envelopes. The report is based on a query. Now I
need to make 10 more queries to make different selections of addresses.
Every query has the same output fields as the already existing query. I know
I can copy the report and base it on another query but then I would have to
make 10 extra reports. How can I use just one report for all of the queries?
At the moment I use the button wizard in my forms to make buttons that start
the particular reports. Resulting code looks like this:

Private Sub Knop34_Click()
On Error GoTo Err_Knop29_Click

Dim stDocName As String

stDocName = "Alle leden per Bezorgcategorie"
DoCmd.OpenReport stDocName, acPreview

Exit_Knop29_Click:
Exit Sub

Can I perhaps add some code that points which query the report should be
based on?
Thanks,
john




Jeff L写道:

Jeff L wrote:

您的10个查询有何不同?在我看来像你一样

应该能够通过一个查询,一个报告以及

或许过滤器完成所有这些操作。
What is different about your 10 queries? It seems to me like you
should be able to do all of this with one query, one report, and
perhaps a filter.



如果你看一下OpenReport方法,你会发现其中一个

参数是Where Condition,这是任何一个有效的Where子句(减去

WHERE关键字)。

DoCmd.OpenReport" MyReport",acViewPreview ,," [FieldX] =''" &

表格![MyOpenForm]![txtValue]& "''"

If you look at the OpenReport method, you will see that one of the
arguments is "Where Condition", which is any valid Where clause (minus
the WHERE keyword).
DoCmd.OpenReport "MyReport", acViewPreview, , "[FieldX]= ''" &
Forms![MyOpenForm]![txtValue] & "''"


查询之间的差异是选择标准。对于

实例:

1.所有成员

2.今年的新成员

3。特定邮政编码区域的会员

4.女性会员

5.今年的男性会员



我不知道怎么把它放在一个查询或报告中。

john


" Jeff L" < jl ******* @ hotmail.comschreef在bericht

新闻:11 ********************** @ m73g2000cwd.googlegr oups.com ...
The differences between the queries are the selection criteria. For
instance:
1. All members
2. This year''s new members
3. Members of a specific zipcode area
4. Female members
5. This year''s male members
etc.
I don''t know how to put this in one query or report.
john

"Jeff L" <jl*******@hotmail.comschreef in bericht
news:11**********************@m73g2000cwd.googlegr oups.com...

您的10个查询有何不同?在我看来像你一样

应该能够通过一个查询,一个报告以及

或者过滤器完成所有这些操作。


john写道:
What is different about your 10 queries? It seems to me like you
should be able to do all of this with one query, one report, and
perhaps a filter.

john wrote:

>我有一份打印信封的报告。该报告基于查询。现在我需要再做10个查询来做出不同的地址选择。
每个查询都有与现有查询相同的输出字段。我知道
我可以复制报告并将其建立在另一个查询的基础上,但之后我会再发布10个额外的报告。如何只为所有
查询使用一个报告?
目前我在表单中使用按钮向导来制作按钮以启动特定报告。结果代码如下所示:

Private Sub Knop34_Click()
On Error GoTo Err_Knop29_Click

Dim stDocName As String

stDocName =" ; Alle leden per Bezorgcategorie"
DoCmd.OpenReport stDocName,acPreview

Exit_Knop29_Click:
退出子

我是否可以添加一些指向哪个查询的代码报告应该基于?
谢谢,
john
>I have a report to print envelopes. The report is based on a query. Now I
need to make 10 more queries to make different selections of addresses.
Every query has the same output fields as the already existing query. I
know
I can copy the report and base it on another query but then I would have
to
make 10 extra reports. How can I use just one report for all of the
queries?
At the moment I use the button wizard in my forms to make buttons that
start
the particular reports. Resulting code looks like this:

Private Sub Knop34_Click()
On Error GoTo Err_Knop29_Click

Dim stDocName As String

stDocName = "Alle leden per Bezorgcategorie"
DoCmd.OpenReport stDocName, acPreview

Exit_Knop29_Click:
Exit Sub

Can I perhaps add some code that points which query the report should be
based on?
Thanks,
john



这篇关于使用一个报告进行不同的查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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