Populate PDF Forms from Access and vice versa (import values from Forms into Access) (1 Viewer)

Willem2904

Registered User.
Local time
Today, 20:24
Joined
Aug 17, 2015
Messages
20
Hi Everyone,

I found the following code very useful to populate PDF Forms from an excel spreadsheets, and the other way around, to populate the Excel spreadsheet with data from the PDF Forms:

https://www.myengineeringworld.net/2013/10/read-and-write-pdf-forms-from-excel-vba.html

However, instead of using an Excel Spreadsheet, I want to use my MS Access database (let's say a table called "Data"). However, I don't know how to change the code so it can be used in Access.

Any help would be greatly appreciated!
 

CJ_London

Super Moderator
Staff member
Local time
Today, 19:24
Joined
Feb 19, 2013
Messages
16,629
you just need the reference to cells to be changed to the fields of your table. However there are plenty of examples online of using access instead of excel - here is an example, see post #2

http://www.vbaexpress.com/forum/showthread.php?21503-Populate-PDF-Form-via-VBA

it doesn't have the error checking, but that would be the same per your example

And of course, you still need acrobat professional
 

Willem2904

Registered User.
Local time
Today, 20:24
Joined
Aug 17, 2015
Messages
20
i have now managed to populate the PDF forms with data from the access database (so the "Write" part is OK).
Now I just need to figure a way to to the "reading part".
 

Jeffr.Lipton

Registered User.
Local time
Today, 11:24
Joined
Sep 14, 2018
Messages
31
i have now managed to populate the PDF forms with data from the access database (so the "Write" part is OK).
Now I just need to figure a way to to the "reading part".

I hope to be getting Adobe Acrobat Pro soon, so I can try it, but it seems to me that you would just reverse the assignment. Instead of
Code:
If f.type="Text" Then Fields.Item(f).Value = "something"
you would have
Code:
If Fields.Item(f).Value = "something" Then f.type="Text"

Hope this helps.
 

Users who are viewing this thread

Top Bottom