Make Table Query

C

Charles

I am trying to automate a procedure where a table is automatically made,
using a make table query, when the user pushes a button to save a record.
The problem occurs when the user presses the "Save" button they get a
warning message box that says "You are about to run a make table query that
will modify data in your table - Do you want to continue anyway?". After
they press "yes" they get a second warning message box that says "The
existing table will be deleted before you run the query. - Do you want to
continue anyway?". After they press "yes" to this question, they then get a
third warning message box that says "You are about to paste '20' rows into a
new table."

Obviously this is a major pain in the rear. I just want Access to do all of
this in the background, transparent to the user. How do I go about getting
these message boxes to quit appearing everytime I try to run a make table
query?

Thank You

Charles
 
T

tina

in a macro, use a SetWarnings action before the OpenQuery action, setting
warnings to False.

in VBA, use a SetWarnings action before AND after the OpenQuery action,
setting warnings to False and then back to True. (in a macro, warnings is
reset to True automatically after the macro ends.)

or, in VBA, use

CurrentDb.Execute "MyQueryName", dbFailOnError

instead of DoCmd.OpenQuery.

hth
 
C

Charles

Thank you very much. I used the SetWarnings Action in VBA and it worked
fine.

I do have one more warning message that keeps coming up and not sure how to
go about getting rid of it. I have a button that duplicates a record.
Whenever the user exits the form they get a warning message that states:
"You copied a large amount of data onto the clipboard - Do you want to save
this data on the clipboard". Currently, I have told the users to just click
the "No" button whenever they see this message. If I use the SetWarnings
Action on the "On Close" event how would I turn it back on? Also, if I do
set the SetWarnings Action to False, does that mean the data will
automatically be saved to the clipboard?

Thank You
 
T

tina

you've got me stumped with that one, Charles. you might be able to get
around the problem by using an Append query to add a duplicate record
(though i do cringe a bit at the thought of a duplicate record in a table)
rather than a copy/paste solution. other than that, suggest you wait until
10/4 morning to see if anyone else picks up this thread - if not, you might
want to post it again in a new thread.

hth
 
Top