I have a query that is too complex for a report, so I turned it into a make table query and then based the report on that table which works fine. I have that report tied to a switchboard. What when I press that button I have to answer the two message that come up when you run a make table query. Something like, tbl xyz will be deleted and you are about to paste x rows. Is there a way that I can default to yes for both of those so the user doesn't have to press yes both times? Thanks!
Make the first line of the macro a SetWarnings and set for No and the macro will run straight through.
BE SURE TO REMEMBER THIS!!!!! When you use the SetWarnings for macros, BE sure once you set them to FALSE, right after it runs your command to set it back to SetWarnings = TRUE
That setting can Cancel out ALL of your Access warning messages. If you created a NewTable from that query, what you should have done in effect was to create yet another query from that and then in your code behind the CommandButton that runs it use this instead:
That handles avoiding the Warning messages as well as keeps you from someday setting your warnings to OFF and forgetting to set them back ON again. Just a tip from what I learned in the past. Also, it's best to run Reports and Forms based on Queries. Yes, you can use Tables, but the more precise way is to use a Query. Also, one other note....try getting rid of your Macros and get used to VBA. It's much more flexible that Macros and when you Export forms and reports, you don't have to remember to find all of the associated macros that go with them. Code created in Form and Report Modules stay with them. How I learned to create VBA was to use the feature in Access to ConvertMacrosToCode. From that point I learned and lately don't have any more databases with Macros in them. And believe me, I am not a programmer, but hey, I'm learning. Just trying to be of help. Have a nice one.
I am using Access 95 and SetWwarnings at No only applies to the particular macro.
I just tried running a Macro which runs a Delete query followed by an Append query and with SetWarnings at No and then ran another macro that also runs a couple of queries and I had removed the SetWarnings line and it brought up the warnings. I also tried running an append query from the data base window after running the macro with SetWarnings at No and the warnings came up.