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?
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?
Code:
DoCmd.OutputTo acOutputReport, "BacTPDF", "(*.pdf)", ("C:\Temp\" & Me.BacTName & [Form_BacTQuery Subform].BacT_ID & ".pdf")
Comment