Import from fillable PDF (1 Viewer)

NearImpossible

Registered User.
Local time
Yesterday, 20:26
Joined
Jul 12, 2019
Messages
225
Not sure if this is where this would go, but Is it possible to import fields from a fillable PDF file into a table in access without having to convert the PDF to another format?

What I would like to do is select a completed fillable PDF file, which would create a new record in the table, and then import the PDF fields to specific fields in the table.

I receive a fillable PDF with 25 fields, but based based on the project, not all field are used. Currently I either have to copy and paste, or hand type, the information into an access form, but if I could automate the process, it would speed things up a bit.

If it makes it any easier, I am using the full version of Acrobat as well.

Thank you
Kevin
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:26
Joined
Oct 29, 2018
Messages
21,454
Hi Kevin. Take a look at this demo page and try downloading the third file. I am hoping it will help you find the way.
 

NearImpossible

Registered User.
Local time
Yesterday, 20:26
Joined
Jul 12, 2019
Messages
225
Hi Kevin. Take a look at this demo page and try downloading the third file. I am hoping it will help you find the way.

At a quick glance, thats a pretty sweet setup as it was able to identify all the fields. I'll have to dig into it more later and let you know what I come up with.

thank you
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:26
Joined
Oct 29, 2018
Messages
21,454
At a quick glance, thats a pretty sweet setup as it was able to identify all the fields. I'll have to dig into it more later and let you know what I come up with.

thank you
Hi. I haven't ran it in a while but doesn't it also include showing the value in the fields? If so, that's what I was hoping will help you get the values from the PDF into your database. Good luck!
 

NearImpossible

Registered User.
Local time
Yesterday, 20:26
Joined
Jul 12, 2019
Messages
225

NearImpossible

Registered User.
Local time
Yesterday, 20:26
Joined
Jul 12, 2019
Messages
225
Hi. I haven't ran it in a while but doesn't it also include showing the value in the fields? If so, that's what I was hoping will help you get the values from the PDF into your database. Good luck!

looks like its just the field names...
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:26
Joined
Oct 29, 2018
Messages
21,454
looks like its just the field names...
I guess my memory failed me. Try adding the "value" property. Hopefully, it will work. I won't be able to do any testing for a while.
 

NearImpossible

Registered User.
Local time
Yesterday, 20:26
Joined
Jul 12, 2019
Messages
225
I guess my memory failed me. Try adding the "value" property. Hopefully, it will work. I won't be able to do any testing for a while.

Using your original code I can get all the field names and If I declare and hard code each field, I can get the Value property to work. This will work as the fields won't change, unless I update the form, but looking more into it, there are over 50 fields returned from your code so an automated process would be ideal.

I just used 1 field as an example below.

your Original Code of
Code:
Me.txtFields = Me.txtFields & jso.getNthFieldName(lngCounter) & vbCrLf
gave me the "ADP" field name.

If I declare ADP as a string and add

Code:
Me.txtFields = Me.txtFields & jso.getField("ADP").Value & vbCrLf

I get every field listed followed by the value of ADP, i.e.

ADP
140


This tells me I just need to figure out how to declare and pass the field names (me.txtFields) to the value property and i'll be set
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:26
Joined
Oct 29, 2018
Messages
21,454
Using your original code I can get all the field names and If I declare and hard code each field, I can get the Value property to work. This will work as the fields won't change, unless I update the form, but looking more into it, there are over 50 fields returned from your code so an automated process would be ideal.

I just used 1 field as an example below.

your Original Code of
Code:
Me.txtFields = Me.txtFields & jso.getNthFieldName(lngCounter) & vbCrLf
gave me the "ADP" field name.

If I declare ADP as a string and add

Code:
Me.txtFields = Me.txtFields & jso.getField("ADP").Value & vbCrLf
I get every field listed followed by the value of ADP, i.e.

ADP
140


This tells me I just need to figure out how to declare and pass the field names (me.txtFields) to the value property and i'll be set
Hi. Try updating this code:
Code:
Me.txtFields = Me.txtFields & jso.getNthFieldName(lngCounter) & vbCrL
into this:
Code:
Me.txtFields = Me.txtFields & jso.getNthFieldName(lngCounter) & ": " & jso.getNthFieldName(lngCounter).Value & vbCrLf
Hope it helps...
 

NearImpossible

Registered User.
Local time
Yesterday, 20:26
Joined
Jul 12, 2019
Messages
225
Hi. Try updating this code:
Code:
Me.txtFields = Me.txtFields & jso.getNthFieldName(lngCounter) & vbCrL
into this:
Code:
Me.txtFields = Me.txtFields & jso.getNthFieldName(lngCounter) & ": " & jso.getNthFieldName(lngCounter).Value & vbCrLf
Hope it helps...

I tired that before and even just adding the .value to the end of the original string and get

424:Object Required
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:26
Joined
Oct 29, 2018
Messages
21,454
I tired that before and even just adding the .value to the end of the original string and get

424:Object Required
Okay, sorry. I'll have to look into it later then. I'll let you know if I find the answer. In the meantime, I suppose you could save the field names in a temp table and then loop through them to get the values from the PDF file. Just a thought...
 

NearImpossible

Registered User.
Local time
Yesterday, 20:26
Joined
Jul 12, 2019
Messages
225
Okay, sorry. I'll have to look into it later then. I'll let you know if I find the answer. In the meantime, I suppose you could save the field names in a temp table and then loop through them to get the values from the PDF file. Just a thought...

I just got it !!

Code:
Me.txtFields = Me.txtFields & jso.getNthFieldName(lngCounter) & ": " & jso.getField(jso.getNthFieldName(lngCounter)).Value & vbCrLf

Now to assign it to a table and i'm set

Thanks for your awesome code and help !!!
Kevin
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:26
Joined
Oct 29, 2018
Messages
21,454
I just got it using both of these lines, looks like I need to do some renaming of my fields, lol

Code:
Me.txtFields = Me.txtFields & jso.getNthFieldName(lngCounter) & vbCrLf
Me.txtFields = Me.txtFields & jso.getField(jso.getNthFieldName(lngCounter)).Value & vbCrLf
Thanks for your awesome code and help !!!
Kevin
Hi Kevin. Congratulations! Glad to hear you got it sorted out. Good luck with the rest of your project.
 

NearImpossible

Registered User.
Local time
Yesterday, 20:26
Joined
Jul 12, 2019
Messages
225
look at previous post for cleaned up code, guess you posted as I modified my response
 

NearImpossible

Registered User.
Local time
Yesterday, 20:26
Joined
Jul 12, 2019
Messages
225
Finally getting around to digging into this more, I noticed that its listing all the fields in alphabetical order, is there anyway to make it list them in the layout order, i.e. 1st field on form is 1st field listed, 2nd field is 2nd listed, etc.?
 
Last edited:

Users who are viewing this thread

Top Bottom