Ok, so I am a very novice user of Access and I have some ability to code in VBA, but not much.
A little background: I did not create this Database, I inherited it. This database is used to generate EPA documentation for thousands of requests a year. It imports the data from an excel sheet, and after the import is done, I click Print on the form and the printer prints out the documentation. I then Fax the paperwork to where it needs to go. This is time consuming and uses tons of paper.
I have 2 issues that I would like changed:
1. How can I have it print all 4 reports at once? Right now it treats the printing as 4 different print jobs, and the printer that I use puts an extra sheet inbetween the print jobs with the user name since multiple people use the printer.
2. When I click the print button, I want the report saved as a PDF file. I don't care if it opens a Save As dialog box, in fact I think I prefer it so that I can name it what I want and put the fine where it needs to go. But I don't know how to make the code work.
Here is what I have right now:
Private Sub PrintForms_Click()
If IsNull([ImportDataList]) Then
MsgBox ("Please select a shipment.")
Else
DoCmd.OpenReport "Rpt Fax Cover", , , "[Batch] = " & [ImportDataList]
DoCmd.OpenReport "TestEPAPage1"
DoCmd.OpenReport "TestEPAPage2"
DoCmd.OpenReport "Rpt EPA Datasheet", , , "[Batch] = " & [ImportDataList]
End If
End Sub
So how do I make it so that it will put all 4 reports into 1 PDF file? I am using Access 2007, and I have downloaded and installed the Add-in from Microsoft for PDF files, but I am not sure how to put the code in for this. I tried playing around with it and I was able to get the save as box to pop up and when I gave it a test name, it wanted to print 1000s of pages of just Rpt Fax Cover, because that is where I started to play with the code.
I am not sure how the "[Batch] = " & [ImportDataList] statement works, but I know that when the data is imported the shipping data is put in a table called Import Data, and the individual units that are being shipped on that shipment are put in a table called Units Imported.
If you are confused, I'm sorry, I'm trying to make this clear while not novel length. thanks for any help, it will definately be appreciated!
A little background: I did not create this Database, I inherited it. This database is used to generate EPA documentation for thousands of requests a year. It imports the data from an excel sheet, and after the import is done, I click Print on the form and the printer prints out the documentation. I then Fax the paperwork to where it needs to go. This is time consuming and uses tons of paper.
I have 2 issues that I would like changed:
1. How can I have it print all 4 reports at once? Right now it treats the printing as 4 different print jobs, and the printer that I use puts an extra sheet inbetween the print jobs with the user name since multiple people use the printer.
2. When I click the print button, I want the report saved as a PDF file. I don't care if it opens a Save As dialog box, in fact I think I prefer it so that I can name it what I want and put the fine where it needs to go. But I don't know how to make the code work.
Here is what I have right now:
Private Sub PrintForms_Click()
If IsNull([ImportDataList]) Then
MsgBox ("Please select a shipment.")
Else
DoCmd.OpenReport "Rpt Fax Cover", , , "[Batch] = " & [ImportDataList]
DoCmd.OpenReport "TestEPAPage1"
DoCmd.OpenReport "TestEPAPage2"
DoCmd.OpenReport "Rpt EPA Datasheet", , , "[Batch] = " & [ImportDataList]
End If
End Sub
So how do I make it so that it will put all 4 reports into 1 PDF file? I am using Access 2007, and I have downloaded and installed the Add-in from Microsoft for PDF files, but I am not sure how to put the code in for this. I tried playing around with it and I was able to get the save as box to pop up and when I gave it a test name, it wanted to print 1000s of pages of just Rpt Fax Cover, because that is where I started to play with the code.
I am not sure how the "[Batch] = " & [ImportDataList] statement works, but I know that when the data is imported the shipping data is put in a table called Import Data, and the individual units that are being shipped on that shipment are put in a table called Units Imported.
If you are confused, I'm sorry, I'm trying to make this clear while not novel length. thanks for any help, it will definately be appreciated!