FORMS GURU LEVEL QUESTION -Exporting FormField info to a SQL Datab

B

BigWylie1

How would I capture specific form fields protected in a Word Protected
document form.
More specifically, I am creating a sales proposal tool for our sales team in
a Word Table formatted document. 300 'cell' in this table.
Once the sales person completes the document fields we would ike to have
some type of "log" button to transmit a small portion of the data ( 10
fields) inputted into a SQL server database.

Can a "log/submit" button EXPORT Specified bookmarked "cell" information
inputted by the sales person into the SQL dbase? If so what is the procedure
for setting up this type of "button".

PLEASE HELP
 
J

Jezebel

This is entirely straightforward if you know how to write VBA code, but not
otherwise.

1) The contents of the form field are each identifable by bookmark, as shown
in the form field properties dialog.

2) In VBA you write an SQL statement using the form field values, open the
database and execute the SQL statement.

3) You associate the log/submit button with the macro that does all this.


Do a Google on VBA code samples: what you're asking is a very common
requirement.
 
D

Dian D. Chapman, MVP

You can use ADO (ActiveX Data Object) to connect to your DB, using the
SQL Provider (driver), such as

'Prompt for username and password
oConn.Properties("Prompt") = adPromptAlways
oConn.Open "Driver={SQL Server};Server=Aron1;DataBase=pubs;"

(If you've done any ASP work...it's very similar.)

You'll then need to either open a table to add a new record or run a
query to find the RS to update. Then capture and pass the info from
the form fields into the DB and update.

You'll find an article on this process, along with a downloadable
sample for Access (which will be more or less the same except for
using the SQL provider versus the Jet one for Access). The code is
open so you can mess with the code, DB and form to see how it works.
You'll find this here:

Word AutoForm Articles
http://www.mousetrax.com/techpage.html#autoforms

Specifically...look for the Please Fill Out This Form series...article
# 5 w/download.

You may also want to check out this book...great for getting you up to
speed, quickly. http://www.mousetrax.com/books.html#ado.

Good luck...

Dian D. Chapman, Technical Consultant
Microsoft MVP, MOS Certified
Editor/TechTrax Ezine

Free MS Tutorials: http://www.mousetrax.com/techtrax
Free Word eBook: http://www.mousetrax.com/books.html
Optimize your business docs: http://www.mousetrax.com/consulting
Learn VBA the easy way: http://www.mousetrax.com/techcourses.html
 

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