Record Macro Using MS Word and MS Query

J

JaMaPoR

I am attempting to create a macro that takes in a user input and uses
that input in a query in MS Query, which in turn uses the produced data
as the data source for a mail merge. However, when recording a macro,
it seems as if it does not record actions performed in MS Query. I
thought of saving it as a query (*.qry), and use this as the data
source, but the query is based upon user input, and thus must be
created on the fly. Has anybody successfully recorded actions in MS
Query using a MS Word Macro?
 
D

Doug Robbins

The macro recorder is useful for some purposes, but what you are trying to
to is not one of them. You could probably use a userform the get the input
and the create the necessary SQL statement with it. But it's something for
which you will need to resort to the use of the Visual Basic Editor.

The article on userforms at
http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm

deals with an entirely different use of userforms, but it may help get you
started.


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 

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