SendKeys in Macro

G

Guest

I am running a macro to open two update queries when unloading a particular
form in my database. The macro includes SendKeys to {ENTER} past the two
confirmations that arise from each of the update queries. I prefer not to
change my options to un-check the confirm action queries. This macro works
on my workstation, however, other users (with much slower machines) are still
be prompted by some of the confirmation dialog boxes, causing them to have to
expend extra mouse clicks. I would like to eliminate these prompts for the
users. I noticed that most postings indicate that SendKeys is not a good
idea -- any suggestions for getting past this? -- I have some VBA, but when I
attempted, I still couldn't seem to eliminate the confirmation prompts... any
help would be appreciated.
 
A

Allen Browne

Try:
With dbEngine(0)(0)
.Execute "Query1", dbFailOnError
.Execute "Query1", dbFailOnError
End With
replacing Query1 and Query2 with the name of your 2 action queries.

That will be more useful than turning SetWarnings off, since that approach
would not let you know if the action queries failed.
 
G

Guest

Works Great!!! Thanks so much!!

Allen Browne said:
Try:
With dbEngine(0)(0)
.Execute "Query1", dbFailOnError
.Execute "Query1", dbFailOnError
End With
replacing Query1 and Query2 with the name of your 2 action queries.

That will be more useful than turning SetWarnings off, since that approach
would not let you know if the action queries failed.
 

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