grahma_aiken
Registered User.
- Local time
- Today, 06:18
- Joined
- Apr 18, 2012
- Messages
- 10
I have a VBA procedure (Access 2016) that writes to form fields in a PDF file. One of the fields is a zip code, and one of the values I need to send is a zip code beginning in 0. The preceding 0 keeps getting dropped. The form field format category property is set to none, and I can manually type in the zip code with the proceeding zero with no error or formatting change in the PDF.
I have tried Dim Zip as String and Zip = "02110" with the same result. I have tried Cstr("02210") with the same result. I have tried to send a ' before the value and got a Type mismatch error. I have tried to set the form field format category property to Zip Code and get a Type mismatch error. Help!!??
Here is the part that isn't working:
Set AcroApp = CreateObject("AcroExch.App")
Set theForm = CreateObject("AcroExch.PDDoc")
StartDoc "F:\SomePDFDoc.PDF"
theForm.Open (strDoc)
Set jso = theForm.GetJSObject
Dim Field1 As String
Set Field1 = jso.getfield("8")
Field1.Value = "02210"
I have tried Dim Zip as String and Zip = "02110" with the same result. I have tried Cstr("02210") with the same result. I have tried to send a ' before the value and got a Type mismatch error. I have tried to set the form field format category property to Zip Code and get a Type mismatch error. Help!!??
Here is the part that isn't working:
Set AcroApp = CreateObject("AcroExch.App")
Set theForm = CreateObject("AcroExch.PDDoc")
StartDoc "F:\SomePDFDoc.PDF"
theForm.Open (strDoc)
Set jso = theForm.GetJSObject
Dim Field1 As String
Set Field1 = jso.getfield("8")
Field1.Value = "02210"