为报表中基础查询中的字段分配值 [英] Assign a value to a field in the query underlying a report

查看:60
本文介绍了为报表中基础查询中的字段分配值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天,这是我在剧本中的第一篇文章,我很高兴成为一个专家社区的一员,可以把我拉出我有时为自己挖掘的漏洞。我在2000模式下运行XP和Access 2002.


我有一份报告,向成员打印提醒他们所做出的承诺状态。我希望能够为报告底层的查询中的每个成员打开一个标志(或者如果可取的话,在其他地方打开),以确定将在我的打印标签功能中打印的名称和地址。当然,如果只打印几个报告,用户只需转到打印标签功能并单击这几个名称,但我想自动执行此操作,以便打印分数甚至数百个报告的实例。


我试图在MemberID Header'的On Format事件中设置标志,


Me.IncludeInMM = -1


但是我收到了错误 - 无法为此对象分配值然后我去了查询,我发现我无法更新它。这是SQL:


SELECT -------------(报告中包含的所有字段)FROM(tblMembers INNER JOIN((qryPledgesMade1 INNER JOIN tblPledgePayments ON qryPledgesMade1.PledgeID = tblPledgePayments.PledgeID)INNER JOIN qryContributionType ON qryPledgesMade1.PledgeTypeID = qryContributionType.ContributionTypeID)ON tblMembers.MemberID = qryPledgesMade1.MemberID)INNER JOIN qrySumOfContributions ON(tblPledgePayments.PledgeID = qrySumOfContributions.PledgeID)AND(tblMembers.MemberID = qrySumOfContributions。会员ID)

WHERE(((qryPledgesMade1.PledgeAmount)> [SumofContributionAmount]));


任何建议都将不胜感激,我不反对改变我的策略。


提前致谢,

David

Good Day to All, This is my first post to the scripts, and I''m glad to be part of a community of experts that can pull me out of the holes that I sometimes dig for myself. I am running XP and Access 2002 in 2000 mode.

I have a report that prints a reminder to members of the status of pledges that they have made. I want to be able to turn on a flag for each member in the query underlying the report (or somewhere else if it is advisable) to identify whose name and address will be printed in my print label feature. Of course, if there are only a few reports to print, the user can simply go to the print labels feature and click those few names, but I want to do this automatically for those instances where there are scores or even hundreds of reports to print.

I attempted set the flag in the MemberID Header''s On Format event,

Me.IncludeInMM = -1

but I got an error - "could not assign value to this object" and then I went to the query and I see that I cannot update it. Here is the SQL:

SELECT ------------- (All fields included in report) FROM (tblMembers INNER JOIN ((qryPledgesMade1 INNER JOIN tblPledgePayments ON qryPledgesMade1.PledgeID = tblPledgePayments.PledgeID) INNER JOIN qryContributionType ON qryPledgesMade1.PledgeTypeID = qryContributionType.ContributionTypeID) ON tblMembers.MemberID = qryPledgesMade1.MemberID) INNER JOIN qrySumOfContributions ON (tblPledgePayments.PledgeID = qrySumOfContributions.PledgeID) AND (tblMembers.MemberID = qrySumOfContributions.MemberID)
WHERE (((qryPledgesMade1.PledgeAmount)>[SumofContributionAmount]));

Any suggestions will be greatly appreciated, and I am not averse to altering my strategy.

Thanks in advance,

David

推荐答案

你在这里失去了一点(你的SQL也很难读,因为它既没有在[code]标签中也没有布局,所以它可以放在它们中而不会使它最多从页面的一侧滚动。

你想要做什么完全?更新记录中的标志或只是检测应该打印哪些记录?

我是否需要了解表的冗长而复杂的结构?或者这只是一个红鲱鱼?
You''ve lost me a bit here (Your SQL is also very hard to read as it is neither in [code] tags nor laid out so that it can be put in them without making it mostly scroll off the side of the page).
What exactly are you trying to do? Update the flags in the record or simply detect which records should be printed?
Do I need to understand the long and complicated structure of your tables? Or is that simply all a red herring?


谢谢你来救我。我很抱歉没有标记代码;由于我的第一篇文章而导致疏忽。我希望这次能做对。我已经更改了原始查询,但它仍然无效。这是SQL:

Thanks for coming to my rescue. I am sorry for not tagging the code; an oversight due to my first post. I hope to get it right this time. I have changed the original query, but it still does not work. Here is the SQL:

展开 | 选择 | Wrap | 行号


让我们首先将SQL变为清晰易读的格式(如前所述)。
Let''s start by getting the SQL into a legible format (As previously requested).
展开 | 选择 | Wrap | 行号


这篇关于为报表中基础查询中的字段分配值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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