By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,136 Members | 1,054 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,136 IT Pros & Developers. It's quick & easy.

Save current record on form as PDF and loop to next

P: 1
Hi, hopefully someone can help me with this.

I have a table and linked a form to it. My form looks nice (like a report) and has 1000's of records.

Currently i can save each record as a PDF but i have to type the file name (i use the print current record option on cute PDF) and doing this for 1000's of records is horrible.

Can someone help me to create a basic VBA code that i can click one command button and it then saves each record as a PDF using the main field and then move to the next using a loop. At the end i would like a folder with 1000's of PDF's of each of my records named after the main field.

If we can call my form "abc" and the main field / primary key for each record as "xyz" that would be great.

So with the primary key "xyz" this would have each record called "1", "2", "3" etc

I know it would have to open form abc, find xyz key and save record 1 as "1"
repeat for next record and save as "2" etc

Sorry if im not clear but i think i have explained it as basic as i can and hopefully the file / form names are easy for reference purposes.

I use access 2010.

Thank you for any help anyone gives, i appreciate it.
May 20 '12 #1
Share this Question
Share on Google+
1 Reply

Expert 2.5K+
P: 3,072
Basically a form isn't mutch different as a report, thus you might check this code for printing a report to a PDF file:
By creating a recordset processing loop and passing the unique key as filter (and filename) this could be a way to do it yourself.

May 20 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.