A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old December 30th, 2009, 03:50 AM posted to microsoft.public.access.queries
BobC[_6_]
external usenet poster
 
Posts: 89
Default Is there a way to turn off the prompts of a make table query?

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.
  #2  
Old December 30th, 2009, 04:29 AM posted to microsoft.public.access.queries
Gina Whipp
external usenet poster
 
Posts: 3,500
Default Is there a way to turn off the prompts of a make table query?

BobC,

DoCmd.SetWarnings False 'Off
Your TransferSpreadsheet line here
DoCmd.SetWarnings True 'On

--
Gina Whipp

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

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

"BobC" wrote in message
...
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.



  #3  
Old December 30th, 2009, 01:27 PM posted to microsoft.public.access.queries
Bob Barrows
external usenet poster
 
Posts: 475
Default Is there a way to turn off the prompts of a make table query?

BobC wrote:
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


--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


  #4  
Old December 30th, 2009, 02:55 PM posted to microsoft.public.access.queries
Gina Whipp
external usenet poster
 
Posts: 3,500
Default Is there a way to turn off the prompts of a make table query?

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

"Bob Barrows" wrote in message
...
BobC wrote:
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


--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.