My Assistant
![]() ![]() |
|
|
Jan 4 2012, 10:47 AM
Post
#1
|
|
|
UtterAccess Member Posts: 30 |
I use a make-table query to import data from an ODBC source. Using VBA, I delete the old table and then use the following code to run the query.
DoCmd.OpenQuery "qryInvoiceLine" Before running the query, I get a popup asking "You are about to run a make-table query that will modify data in your table... <Yes> <No>" After running the query, I get another popup "You are about to paste 1202 row(s) into a new table... <Yes> <No>" is there a way to avoid these popups so the queries create the tables silently? Thanks, Kurt |
|
|
|
Jan 4 2012, 10:52 AM
Post
#2
|
|
|
UtterAccess Ruler Posts: 1,175 From: Indiana, USA |
Did you try setting the warnings flag to false?
docmd.setwarnings false code...code...code... docmd.setwarnings true |
|
|
|
Jan 4 2012, 10:53 AM
Post
#3
|
|
|
Access Wiki and Forums Moderator Posts: 48,018 From: SoCal, USA |
Hi Kurt,
Creating and deleting tables at runtime could cause database bloat. It is highly recommended to just empty out the table and then use an APPEND query to add the new data in. Either way, try the following syntax to avoid the warning message but still recover in case any error occurs, which you can't do with the SetWarnings method: CurrentDb.Execute "qryInvoiceLine", dbFailOnError Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) |
|
|
|
Jan 4 2012, 11:28 AM
Post
#4
|
|
|
UtterAccess Member Posts: 30 |
Thanks - very helpful!
|
|
|
|
Jan 4 2012, 11:29 AM
Post
#5
|
|
|
UtterAccess Member Posts: 30 |
Thanks! You guys at UA are providing a great service to us recreational hacks. Have a great 2012.
|
|
|
|
Jan 4 2012, 01:09 PM
Post
#6
|
|
|
Access Wiki and Forums Moderator Posts: 48,018 From: SoCal, USA |
Hi,
Thanks! You guys at UA are providing a great service to us recreational hacks. Have a great 2012. (IMG:style_emoticons/default/yw.gif) bulsatar and I (and the rest of UA) are happy to help. Good luck with your project. Happy New Year! (IMG:style_emoticons/default/fundrink.gif) |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 22nd May 2013 - 07:00 PM |