使用子表单字段命名输出PDF [英] Name the output PDF using subform fields

查看:79
本文介绍了使用子表单字段命名输出PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是从前一个帖子中脱颖而出:


http://bytes.com/topic/access/answers/898800-email-multiple-reports


我正在使用下面的代码向pdf输出报告。字段[Me.BacTName]和[Form_BacTQuery Subform] .BacT_ID的名称组成输出文件名。这段代码很好用。这是问题所在:我的子表单可以有多个记录集,每个记录集包含[Form_BacTQuery子表单] .BacT_ID。我希望我输出的文件名是[Me.BacTName]和第一个[Form_BacTQuery子表单] .BacT_ID,连字符的合成,然后是相关记录集中的最后一个[Form_BacTQuery子表单] .BacT_ID。它看起来应该是这样的:WVM212-220。现在我只得到:WVM212。我如何编码以包含子窗体上的最后一个[Form_BacTQuery子窗体] .BacT_ID作为文件名的一部分?这有意义吗?

This is kind of a take off from a previous thread:

http://bytes.com/topic/access/answers/898800-email-multiple-reports

I am outputting a report to pdf using the code below. The name of the fields [Me.BacTName] and [Form_BacTQuery Subform].BacT_ID make up the output file name. This code works good. Here is the problem: My subform can have multiple record sets each containing a [Form_BacTQuery Subform].BacT_ID. I want the file name I out put to be a composite of [Me.BacTName] and the first [Form_BacTQuery Subform].BacT_ID, hyphen, and then the last [Form_BacTQuery Subform].BacT_ID in the associated record sets. It should look something like this: "WVM212-220". Right now I am only getting: "WVM212". How do I code to include the last [Form_BacTQuery Subform].BacT_ID on the subform as part of the file name? Does this make sense?

展开 | 选择 | Wrap | 行号

推荐答案

确实有意义。


首先,您需要了解 [Form_BacTQuery子表单] .BacT_ID 仅指您子表单上当前活动的记录。它甚至不一定是第一个。


我建议你查看通过你的子表单找到的RecordSet(而不是你当前的对象类 - 参见< a href =http://bytes.com/topic/access/insights/599404-referring-items-sub-formtarget =_ blank>参考子表单上的项目)。如果您使用 .RecordSetClone ,则无需移动当前记录。您需要转到开头和结尾,并在[BacT_ID]中记下相关值。
It does make sense.

Firstly, you need to understand that [Form_BacTQuery Subform].BacT_ID refers simply to the currently active record on your subform. It needn''t even necessarily be the first one.

I would advise checking out the RecordSet as found via your subform (rather than via the object class as you are currently - See Referring to Items on a Sub-Form). If you use .RecordSetClone then the current record needn''t even be moved. You need to go to the start and the end and note the related values in [BacT_ID].


Neo,


谢谢。我有点理解你在说什么。我还是不知道如何实现它。我理解你的概念,但我不知道将它们变成实际工作代码的结构。那么,有没有办法包括第一和第一。和最后当前在子表单中显示/过滤的BacT_ID?
Neo,

Thank You. I sort of understand what you are saying. I still don''t know how to implement it. I understand your concepts, but i don''t know the structure for turning them into actual working code. So, is there a way to include the "first" and "last" BacT_ID that is currently showing/filtered in the subform?


我给你的提示将允许您访问过滤的第一个和最后一个项目。它们可能不是可见的,因为可能在您的表单上滚动,但它们可能是过滤器中的第一个也是最后一个。


我很乐意提供帮助在这里,但我不会简单地为你做这件事。我已经为你提供了工具。试试吧。如果你遇到困难,请解释在哪里,我们可以进一步提供帮助。
The tips I gave you will give you access to the first and last of the items filtered. They may not be the ones visible, as there may be scrolling on your form, but they can be the first and last that qualify within the filter.

I''m happy to help here, but I''m not about to simply do it for you. I''ve provided you with the tools. Have a go. If you get stuck then explain where and we can help further.


这篇关于使用子表单字段命名输出PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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