How to put the condition in Macro ?

D

Dawn

I’ve finished a Marco with only the operation “openqueryâ€,
There are two kinds of queries in the Macro.
One is the make-table queries, the other is modify-table queries(for
example: function:â€alter†or “upgrade†)
For the first queries , they need to put in parameter before running.
For the other queries, there is warning msgbox pop-up before running.
My question is ,
1:How to enter the parameter in the macro?
2:How to automatic enter an “Enter†to respond to the warning msgbox.
If the 2 points are realized, the macro is absolutely automatic, not like
semi- automatic for present.
Thanks
Dawn
 
B

bhicks11

Hi Dawn,

If I understand your questions correctly:

to add a condition to your macro command - to show the CONDITION option in
the macro designer, click on VIEW (top menu), click on CONDITION. For a user
response you can use a MSGBOX like this:

MsgBox("Get answer?",1)=1

If the customer clicks YES, the response = 1 and will run the Action. If the
user clicks CANCEL, the action does not run.

I believe this will work in both instances you asked about.

Hope this is helpful.

bhicks11
http://www.dataplus-svc.com
 
S

Steve Schapel

Dawn,

If you put a SetWarnings/No action at the beginning of the macro, this
will take care of the pop-up action query confirmation prompts.

As for the "parameter", can you give a specific example of what you are
talking about? I suppose you men a Criteria that is entered at the time
that the macro is run... is that right? Ideally this is referenced by
putting an unbound textbox on a form, where the user will enter the
criteria before the macro is run, and then the query references the textbox.
 

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