run an access query from infopath

R

Ronos

I've created an Infopath form to collect employee info to an existing Access
database. I've got a working update query to move data between fields in a
selected record. What is the correct syntax to run the access update query
from a button in the infopath form - or can this be done?

Help would be appreciated,
Ron
 
S

S.Y.M. Wong-A-Ton

Did you bind your form to the database? That is, did you use "New from data
connection" when creating the form?
 
R

Ronos

The data connection was created successfully with the wizard upon creating
the new form. The form retrieves & writes info from/to the database
perfectly. What I'm trying to do is add an action button to the form that
runs an update query that resides in the Access database. What is the code
required (or is it possible) in InfoPath to perform this.

Ron
 
S

S.Y.M. Wong-A-Ton

To my knowledge, you cannot call an update query from within Access in
InfoPath. You'll need to use either ADO or a web service or some other method
to perform updates within your Access table, if you do not want to use
InfoPath's interface to do so.
 
R

Ronos

Hm. I figured Infopath is already running queries to pull data and write
info from/to the database to it wouldn't be stretch to execute a query in the
database. I'm wondering if the Access query can be copied and put right in
the Infopath code and executed from there. If not, I'll haver to keep an
Access front end around just to run an update query against the data put in
from Infopath.

Thanks for your input.
 
S

S.Y.M. Wong-A-Ton

I'm afraid cutting and pasting won't work, since InfoPath is totally
different from Access and any other Office application for that matter. So
you'll have to write the code directly within InfoPath or keep your existing
Access front-end as you already hinted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top