Desperately need code to automate Access 2003 from Word 2003

S

smdesq13

I have a Word document that is filled with data. I set up a button o
the document where the user is supposed to click on the button and ru
VBA code. The code is supposed to open an access database and run
select query and then insert new data into the access database. Th
database is in the same directory as the document. I am limited t
starting it from Word with the button. The button works and runs th
VBA. I just don't know what to use to get the database open an
queried. Help would be greatly appreciated. thanks
 
J

Jean-Guy Marcil

smdesq13 was telling us:
smdesq13 nous racontait que :
I have a Word document that is filled with data. I set up a button on
the document where the user is supposed to click on the button and run
VBA code. The code is supposed to open an access database and run a
select query and then insert new data into the access database. The
database is in the same directory as the document. I am limited to
starting it from Word with the button. The button works and runs the
VBA. I just don't know what to use to get the database open and
queried. Help would be greatly appreciated. thanks.

This might be better posted in an access group.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
D

Doug Robbins - Word MVP

Take a look at the last of the following series of articles:

Please Fill Out This Form
Part 1: Create professional looking forms in Word
http://www.computorcompanion.com/LPMArticle.asp?ID=22

Part 2: Adding Automation to your Word forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=46

Part 3: Learn more VBA (macros) to automate your forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=119

Part 4: Use custom dialog boxes in your Word forms
http://www.computorcompanion.com/LPMArticle.asp?ID=127

Part 5: Connect your AutoForm to a database to save input time and keep
better records!
http://www.computorcompanion.com/LPMArticle.asp?ID=136


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

Jean-Guy Marcil

Doug Robbins - Word MVP was telling us:
Doug Robbins - Word MVP nous racontait que :
Take a look at the last of the following series of articles:
Part 5: Connect your AutoForm to a database to save input time and
keep better records!
http://www.computorcompanion.com/LPMArticle.asp?ID=136

I'll have to remember that one. But I thought the poster wanted to run an
Access Query from Word...

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
D

Doug Robbins - Word MVP

The article shows how to access Access from Word. Once that is done, you
can make use of VBA to do almost anything in Access.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

Jean-Guy Marcil

Doug Robbins - Word MVP was telling us:
Doug Robbins - Word MVP nous racontait que :
The article shows how to access Access from Word. Once that is done,
you can make use of VBA to do almost anything in Access.

I know, I meant that Access VBA to run an Access Query (Like to create a
Query Table) is not something one would expect to find in this group, this
is why I got confused and did not even think of only referring the poster to
code to simply make a Database Connection (since I thought he already knew
how to do that...)

My Bad for not understanding the question...

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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