473,320 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

vba how to suppress dialog when modifying records

Hi,
whan I have for example a vba script

stSql = "INSERT INTO table..."
DoCmd.RunSQL stSql

associated with a command, and then I click on it there is an access
popup that informs me how many rows will be affected (inserted,
deleted...).

How can I suppress this dialog?

Thanks,
Lorenzo

May 9 '07 #1
4 12049
Use DoCmd.SetWarnings False to torn warnings off
Use DoCmd.SetWarnings True to torn warnings on

Sub test()
Dim stSql
stSql = "INSERT INTO Temp values(""fred"")"
DoCmd.SetWarnings False
DoCmd.RunSQL stSql
DoCmd.SetWarnings True

End Sub

Cheers,
Alan

lory <gi***************@gmail.comwrote in
news:11**********************@h2g2000hsg.googlegro ups.com:
Hi,
whan I have for example a vba script

stSql = "INSERT INTO table..."
DoCmd.RunSQL stSql

associated with a command, and then I click on it there is an access
popup that informs me how many rows will be affected (inserted,
deleted...).

How can I suppress this dialog?

Thanks,
Lorenzo

May 9 '07 #2
easiest way to do this without having to keep track of whether
warnings are turned on or off is to execute the query directly via
DAO, i.e.

CurrentDB.Execute "INSERT INTO table..."

or ADO if you like... but that's more hassle and probably not worth it
unless you are running and ADP

May 9 '07 #3
On May 9, 3:24 am, Alan Carpenter <N...@iHome.nzwrote:
Use DoCmd.SetWarnings False to torn warnings off
Use DoCmd.SetWarnings True to torn warnings on

Sub test()
Dim stSql
stSql = "INSERT INTO Temp values(""fred"")"
DoCmd.SetWarnings False
DoCmd.RunSQL stSql
DoCmd.SetWarnings True

End Sub

Cheers,
Alan

lory <giannotti.lore...@gmail.comwrote innews:11**********************@h2g2000hsg.googleg roups.com:
Hi,
whan I have for example a vba script
stSql = "INSERT INTO table..."
DoCmd.RunSQL stSql
associated with a command, and then I click on it there is an access
popup that informs me how many rows will be affected (inserted,
deleted...).
How can I suppress this dialog?
Thanks,
Lorenzo- Hide quoted text -

- Show quoted text -
If you use the SetWarnings to TURN warnings on and off be sure to call
the SetWarnings True in the Exit_Routine secion of your sub. If you
dont anfd the code crashed then the SetWarnings may or may not be
processed. Learn to error trap and use it in all of your code.

May 9 '07 #4
On 9 Mag, 21:40, DavidB <j...@yahoo.comwrote:
On May 9, 3:24 am, Alan Carpenter <N...@iHome.nzwrote:


Use DoCmd.SetWarnings False to torn warnings off
Use DoCmd.SetWarnings True to torn warnings on
Sub test()
Dim stSql
stSql = "INSERT INTO Temp values(""fred"")"
DoCmd.SetWarnings False
DoCmd.RunSQL stSql
DoCmd.SetWarnings True
End Sub
Cheers,
Alan
lory <giannotti.lore...@gmail.comwrote innews:11**********************@h2g2000hsg.googleg roups.com:
Hi,
whan I have for example a vba script
stSql = "INSERT INTO table..."
DoCmd.RunSQL stSql
associated with a command, and then I click on it there is an access
popup that informs me how many rows will be affected (inserted,
deleted...).
How can I suppress this dialog?
Thanks,
Lorenzo- Hide quoted text -
- Show quoted text -

If you use the SetWarnings to TURN warnings on and off be sure to call
the SetWarnings True in the Exit_Routine secion of your sub. If you
dont anfd the code crashed then the SetWarnings may or may not be
processed. Learn to error trap and use it in all of your code.- Nascondi testo tra virgolette -

- Mostra testo tra virgolette -
Thanks a lot. Now it is ok.

May 18 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bri | last post by:
AC97 on WinXP, Image control on a Form and on a Report. I have followed the advice on the following MVPS page: http://www.mvps.org/access/api/api0038.htm This states that after changing the...
2
by: samir.kuthiala | last post by:
I do some requests in the background on a page using the XMLHttpRequest object. My site uses NTLM Authentication. However if the user is not logged in, it throws up an ugly dialog box. Is there...
1
by: rn5a | last post by:
A custom server control has a Button. Namespace Confirm Public Class ShowConfirm : Inherits Button Private strConfirmMsg As String Public Property ConfirmMessage() As String Get...
2
by: brianflannery | last post by:
Greetings! My situation is this. I currently have a database of which in a form displays jpeg pictures (one at a time) which are linked to the db and stored in a separate folder. I have set up a...
0
by: Emby | last post by:
Hi, I am aware that the "Printing" dialog displayed by a PrintDocument during the invocation of the doc.Print method can be suppressed by setting the doc's PrintController property to an instance...
0
by: Emby | last post by:
Hi, I am aware that the "Printing" dialog displayed by a PrintDocument during the invocation of the doc.Print method can be suppressed by setting the doc's PrintController property to an...
0
by: =?Utf-8?B?VG9kZE0=?= | last post by:
I am trying the print an html document using Process.Start with the verb "print", which works except it displays the print dialog box. The printer is set correctly to the one specified using the...
3
by: Jon Davis | last post by:
Is there an app.config setting I can add or a System.Diagnostic.Process property I can tweak to cause someone else's CLR 2.0 console app to not show a base CLR dialog box offering to debug the app...
2
by: ZeeHseez | last post by:
Hi, I have written a webbrowser application in VB .net Framework 1.1. I would like to suppress javascript error messages. However, the silent property of the webbrowser control suppresses the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.