Is there a way to turn off the prompts of a make table query?

B

BobC

I merely want to update the table to be used as an export to Excel using
TransferSpreadsheet. Each time it prompts for deleting old records and
adding new records. Is there a was to turn off the prompts?
Bottom line - I want to create an Macro to export the output of a query
to an Excel spreadsheet.
 
B

Bob Barrows

BobC said:
I merely want to update the table to be used as an export to Excel
using TransferSpreadsheet. Each time it prompts for deleting old
records and adding new records. Is there a was to turn off the
prompts? Bottom line - I want to create an Macro to export the output of a
query to an Excel spreadsheet.

As Gina hinted, without really saying so, you won't be able to accomplish
directly this with a Macro. You will have to use VBA code, which can be
called by a Macro, but I'm not really sure why a macro would be needed. You
can call VBA code using a button on a form as simply as you can call a
macro.

Anyways, I do think some error-handling should be added to Gina's suggestion
so that if an error occurs, you won't be stuck with Warnings turned off
until the user turns them back on via Tools|Options or restarts Access.

Sub SpreadSheetXferNoWarnings()
On Error Resume Err_Handler
DoCmd.SetWarnings False 'Off

Your commands to update the table
and transfer the spreadsheed here

Exit_Sub:
DoCmd.SetWarnings True 'On
Exit Sub

Err_Handler:
Msgbox Err.Description
GoTo Exit_Sub
End Sub
 
G

Gina Whipp

Both Bob's...

BobC... You can actually do what I suggested in a Macro BUT as Bob Barrows'
suggested you should put in some error code and THAT you can't accomplish
with a Macro.

Bob Barrows... Thanks for catching the MACRO part, my eyes skipped right
over that!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 

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