Stop Make-Table Query Pop-ups

ccflyer

Registered User.
Local time
Today, 06:42
Joined
Aug 12, 2005
Messages
90
I have a make table query that is run through a macro right now. This is what I have in my macro action section so far:
Code:
OpenQuery
Close
I don't want the user to see anything when the query runs, and they don't see the actual query, but they see three popup boxes like this

First One:
Code:
You are about to run a make-table query that will modify data in your table.
                         Are You Sure?
                |Yes|         |No|       |Help|

Second One:
Code:
The exsisting table will be deleted.
            Continue?
         |Yes|    |No|

Third One:
Code:
You are about to paste 3 Rows into a new table. Continue?
                  |Yes|        |No|
Does anyone know how to make it so the user never sees this using the same macro?

-Chris
 
Look at the SetWarnings action. But make sure you remember to turn warnings back on afterwards.
 
No, that didn't really work. I added a SetWarnings action inbetween OpenQuery and Close and set the parameter to 'No', but it didn't seem to work, I still saw exactly what I saw before.

-Chris
 
The first thing in your macro needs to be setwarnings = No. Then run all your other stuff. Then setwarnings = yes at the end.
 
I just found that in the options menu, all you have to do to turn off messages 1 & 3 is to uncheck the confirm Action Queries box. So that eliminated two of the three messages but I am still left with number 2 (as shown above).

This is what my macro looks like:
Code:
OpenQuery
SetWarnings(No)
Close
SetWarnings(Yes)
But I still get the message.

-Chris
 
Run your queries in code instead. I used to always attach this kind of sutff to command buttons on a form.

Private Sub Command0_Click()

DoCmd.SetWarnings False
Docmd.openquery "query name"
Docmd.openquery" the next query name"

End Sub
 
Cool, so do you know how to close and save it in VB code? Only asking since my macro also closed the query after it ran (and I am pretty sure it saves it also in a macro as it closes).

-Chris
 
openquery will run whatever type of query it is. If you mean will it actually open and commit the data yes, it will.
 
Hey, I just tried your code but it didn't seem to work. Are you sure that is right.
Here is what I have:

Code:
Private Sub cb1_Click()

DoCmd.SetWarnings False
Docmd.openquery "DateWellPrevious"

End Sub
My Query's name is "DateWellPrevious"

-Chris
 
ccflyer said:
Hey, I just tried your code but it didn't seem to work. Are you sure that is right.
Here is what I have:

Code:
Private Sub cb1_Click()

DoCmd.SetWarnings False
Docmd.openquery "DateWellPrevious"

End Sub
My Query's name is "DateWellPrevious"

-Chris

Yep that's all it should be, try making a test query that opens a select query first. Like "Select * from DateWellPrevious" kind of thing just to see if it is really launching the query.
 
The reason you're still seeing the warnings with the macro is because you are turning warnings off after running your query. You need to:

SetWarnings(No)
OpenQuery
Close
SetWarnings(Yes)

You want to be careful turning off warnings in the option menu, as one day, it'll come back and bite you.

If you're now running your query in code make sue you turn those warnings back on!

Code:
Docmd.SetWarnings = True
 

Users who are viewing this thread

Back
Top Bottom