Ajit Singh
Registered User.
- Local time
- Yesterday, 18:10
- Joined
- Jul 11, 2013
- Messages
- 34
Am using below code for generating set of pdf files in a desired folder........similarly I have another code, which generates another set of pdf file in another folder.....Count and Filename is identical in both the folders and I need to merge the file names with identical names together....separate binder file would also work.......Can anybody help me with the resolution of this asap.
Private Sub Command14_Click()
Dim strDefaultPrinter As String
strDefaultPrinter = Application.Printer.DeviceName
Set Application.Printer = Application.Printers("Adobe PDF")
Dim rst As DAO.Recordset
Dim fullreportname, AJIT, CustomerID, ReportingMonth As String
Set rst = CurrentDb.OpenRecordset("UniqueCostCenters_E&C", dbOpenDynaset)
With rst
Do Until .EOF
CustomerID = !CostCenter
ReportingMonth = !Month
fullreportname = "SAP Line Item for " & ReportingMonth & "_" & CustomerID
AJIT = "SAP Line Item Report-YTD"
'Me.Combo12 = rst.Fields("CostCenter")
DoCmd.CopyObject , fullreportname, acReport, "SAP Line Item Report"
DoCmd.OpenReport fullreportname, , , "CostCenter='" & CustomerID & "'"
DoCmd.Close acReport, fullreportname, acSaveNo
''''Is it possible to append below report in above created report?
DoCmd.SetWarnings False
DoCmd.CopyObject , fullreportname, acReport, AJIT
DoCmd.OpenReport fullreportname, , , "CostCenter='" & CustomerID & "'"
DoCmd.Close acReport, fullreportname, acSaveNo
.MoveNext
DoCmd.DeleteObject acReport, fullreportname
Loop
.Close
End With
Set rst = Nothing
Set Application.Printer = Application.Printers(strDefaultPrinter)
End Sub
Private Sub Command14_Click()
Dim strDefaultPrinter As String
strDefaultPrinter = Application.Printer.DeviceName
Set Application.Printer = Application.Printers("Adobe PDF")
Dim rst As DAO.Recordset
Dim fullreportname, AJIT, CustomerID, ReportingMonth As String
Set rst = CurrentDb.OpenRecordset("UniqueCostCenters_E&C", dbOpenDynaset)
With rst
Do Until .EOF
CustomerID = !CostCenter
ReportingMonth = !Month
fullreportname = "SAP Line Item for " & ReportingMonth & "_" & CustomerID
AJIT = "SAP Line Item Report-YTD"
'Me.Combo12 = rst.Fields("CostCenter")
DoCmd.CopyObject , fullreportname, acReport, "SAP Line Item Report"
DoCmd.OpenReport fullreportname, , , "CostCenter='" & CustomerID & "'"
DoCmd.Close acReport, fullreportname, acSaveNo
''''Is it possible to append below report in above created report?
DoCmd.SetWarnings False
DoCmd.CopyObject , fullreportname, acReport, AJIT
DoCmd.OpenReport fullreportname, , , "CostCenter='" & CustomerID & "'"
DoCmd.Close acReport, fullreportname, acSaveNo
.MoveNext
DoCmd.DeleteObject acReport, fullreportname
Loop
.Close
End With
Set rst = Nothing
Set Application.Printer = Application.Printers(strDefaultPrinter)
End Sub