Hi, Im brand new on this forum and know only the bare rudiments of VBA, so please be gentle, and explain things in idiot language :)
I have some code in Access 2010 which runs various queries and then opens a report. The last steps of this code set my printer to CutePDF and then prints the report. Because CutePDF is a PDF writer, the Save As dialog box is displayed, which allows me to give the PDF file a name. So far so good.
But I need to do this 30+ times, each time using a different entry in my table as a parameter, a bit like having 30 customers. Assuming that I wanted to save the files in the same folder each time, overwriting the previous ones, how can I use code to say something like the following?
Obviously this code is not written correctly, but I hope it explains the logic of what Im trying to achieve. Im using Access 2010 on Windows XP Professional, if that makes any difference.
Thank you
I have some code in Access 2010 which runs various queries and then opens a report. The last steps of this code set my printer to CutePDF and then prints the report. Because CutePDF is a PDF writer, the Save As dialog box is displayed, which allows me to give the PDF file a name. So far so good.
But I need to do this 30+ times, each time using a different entry in my table as a parameter, a bit like having 30 customers. Assuming that I wanted to save the files in the same folder each time, overwriting the previous ones, how can I use code to say something like the following?
Code:
X = CountOf([NameOfEntry]) from MyTable
For N = 1 to X
Read [NameOfEntry] from MyTable
Run the various queries - I can do this part!
Print the report to PDF - and this part!
Save As..C:\Desktop\Reports\[NameOfEntry]; Overwrite = Yes
Next N
Thank you