These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

prefilled form from Access

jillen
Registered: Jan 26 2009
Posts: 6
Answered

Hi,
I'm new to Acrobat, using Acrobat Pro 9. I'm trying to launch an Acrobat prefilled and fillable form from an Access form. I see how to create a prefilled form by linking a datasource to it. It can be an Access query, so far so good. But, I still have 2 questions...

1. how would I pass a parameter? Specifically, if the user selected from a combo box on the form, I want to limit the results to that selection.

2. How do I open the Acrobat form from Access vba? Shell command?

I found some info on how to create an xfdf file, then open/run it using a shell command. Is that the best way?

TIA,
Joanne

My Product Information:
Acrobat Pro 9.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Since you mention linking the form to a "datasource" I have to assume that you are using a LiveCycle Designer form? is this correct?

But regardless, connecting directly to a Database is something that can only be done on your local system/network, it doesn't work for distributed forms. Is this what you want to do?

There are many ways to approach pre-populating a form. what is your process?

From a VB, or VBA program you can open a PDF in Acrobat using the IAC (inter-application communication) interface. You'll find the reference document on this at www.adobe.com/devnet. But using a shell command to open a PDF from a data file (XFDF, FDF, XFD, or XDP) will work just fine. In fact, you can use this to open a pre-populated form from a web link.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

jillen
Registered: Jan 26 2009
Posts: 6
Hi Thom,

Thanks for your reply. Here's what I'm trying to do...
I have several forms where the majority of the data is in a database (SQL Server, if it matters.) However, there are a few fields that the user will need to fill out. This is an internal process. One or two people will run these forms for a selected client, fill out the rest and print it.

I saw that I could use LiveCycle Designer to run the form on the server, linked to a datasource. However, I don't know how to pass the 'selected client' parameter from the Access form, nor do I know how to launch the Acrobat form from vba. (I read somewhere that I can use the Shell command to launch the Acrobat Reader, but haven't tried it.)

So, I went down another path, using Acrobat Pro to create a form with text fields. Then in Access, in the vba behind the form, I get the recordset using the parameter and write out an xfdf file. I use the Shell command to run it. This works fine, but seems ridiculously complicated for what I'm trying to do.

I'm finding it interesting in a way to just poke around at my options, but at some point the boss might disagree :)
Any thoughts you might have would be appreciated. I'm going to take a look at the IAC interface that you mentioned next.

Thanks again,
Joanne
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Connecting a PDF form (AcroForm or LiveCycle) is never straight forward. Unless of course you hire a service to do it for you;) But I think you've discovered the easiest method, i.e., importing data from one of the data file types that Acrobat Recognizes. With this methodology you avoid having to learn how to deal with a DB in either LiveCycle or Acrobat JavaScript. There is definately a learning curve there.

BTW: this same methodolgy will work with the LiveCycle form using a different data format (XDP).

Since you are using an AcroForm, and this is a local process, then you could use the [b]ADBC[/b] object in Acobat JavaScript. This object is a way of connecting an ODBC registered database. You could do this in one of two ways.

1) Place a button on the form that when pressed, runs some JavaScript that goes out to the DB, grabs the record you're interested in, and then populates the form.

2) Create a JavaScript automation tool for acrobat that does essentially the same thing.

Both of these methodologies require learning about Acrobat JavaScript. There is a great ADBC usage Sample, and lots of tutorial on Acrobat JavaScript at www.pdfscripting.com. You can also find a some miscellaneous info on this topic by doing a google search on "Acrobat ADBC objec"

However, if you are comfortable with VBA, and your current solution works, I would suggest sticking with that, regardless of how awkward it may seem.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

jillen
Registered: Jan 26 2009
Posts: 6
Hi Thom.,

I'm going to take your advice and stick with the VBA path that I'm on now. However, I already know of other processes that will require this capability. So, I plan on looking into the ADBC object and Javascript. Not looking forward to all of those semi-colons...I'm a VBScript person :)

Thanks for all of your input. As usual, I'm trying to learn a new product AND see results. I know that a learning curve falls in the middle there! I'm sure the tutorials, etc will be a great help.

Regards,
Joanne