473,795 Members | 2,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remove "Yes" "No" Confirmation from Queries

3 New Member
I have created an append query that I would like to run when the DB is opened.
However I do not want the end user to receive the "yes" "no" confirmation box when the query is being run.

Can anyone help me remove this confirmation box?
Feb 20 '08 #1
6 6538
pelicanstuff
24 New Member
I have created an append query that I would like to run when the DB is opened.
However I do not want the end user to receive the "yes" "no" confirmation box when the query is being run.

Can anyone help me remove this confirmation box?
Before the line in the VBA that runs the query add "DoCmd.SetWarni ngs = false"

Afterwards add "DoCmd.SetWarni ngs = true"

I think that's right, but I'm newish.
Feb 20 '08 #2
Scott Price
1,384 Recognized Expert Top Contributor
Before the line in the VBA that runs the query add "DoCmd.SetWarni ngs = false"

Afterwards add "DoCmd.SetWarni ngs = true"

I think that's right, but I'm newish.
The DoCmd.SetWarnin gs = False and True is correct. As an added option, that I now prefer, you can use the more specific:

Expand|Select|Wrap|Line Numbers
  1. Application.SetOption "Confirm Action Queries", False
Do not forget to change it back to True after running your code.

Regards,
Scott
Feb 20 '08 #3
RSbroman
3 New Member
I did figure out one way to do this. Access 07 - Select Office Button, Access Options, Advanced, then uncheck "Action Queries". However this does not remove confirmation box for users other than yourself on your local machine.


When using VB Script all that I see is code for Form. Nothing appears for tables or queries.
Feb 20 '08 #4
pelicanstuff
24 New Member
I did figure out one way to do this. Access 07 - Select Office Button, Access Options, Advanced, then uncheck "Action Queries". However this does not remove confirmation box for users other than yourself on your local machine.


When using VB Script all that I see is code for Form. Nothing appears for tables or queries.
Where is your query running from? I assumed that since you said it was to run on opening of the application, it would be run from the Form_Load() event of your default form like so:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.  
  3. DoCmd.SetWarnings = false
  4. DoCmd.OpenQuery "YourQuery"
  5. DoCmd.SetWarnings = true
  6.  
  7. End Sub
Or is that not how you're doing it?
Feb 21 '08 #5
RSbroman
3 New Member
This took care of it:


Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2. ' Minimize the database window and initialize the form.
  3.  
  4. On Error GoTo Form_Open_Err
  5.  
  6.     ' Minimize the database window.
  7.     DoCmd.SelectObject acForm, "Switchboard", True
  8.     DoCmd.Minimize
  9.  
  10.     ' Move to the switchboard page that is marked as the default.
  11.     Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
  12.     Me.FilterOn = True
  13.  
  14. Form_Open_Exit:
  15.     Exit Sub
  16.  
  17. Form_Open_Err:
  18.     MsgBox Err.Description
  19.     Resume Form_Open_Exit
  20.  
  21. End Sub
  22.  
  23. Private Sub Form_Current()
  24. ' Update the caption and fill in the list of options.
  25.  
  26.     Me.Caption = Nz(Me![ItemText], "")
  27.     FillOptions
  28.  
  29. End Sub
  30.  


Thanks for the help folks.
Feb 27 '08 #6
Scott Price
1,384 Recognized Expert Top Contributor
I commend you on an innovative solution!

I do wonder, however, if this would work equally well without the step you mentioned in post #4? Those Yes/No popup boxes are usually modal, which means that they must be satisfied before moving on with the program.

I don't see anything in your code which changes this default modal behavior, so you must be changing that somewhere else.

Thanks for posting back with your solution.

Regards,
Scott
Feb 27 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
7116
by: TonyJeffs | last post by:
<SCRIPT language="JavaScript"> function anna18(){ window.open ("Slideshow/anna18.htm","","scrollbars=no,fullscreen=yes") } </SCRIPT> Why does the above still have a scrollbar? The actual web site (poor photos of 18th birthday party!) is at: http://www.tonyjeffs.com/Anna18th
7
36718
by: deko | last post by:
I'm getting intermittent "Object Invalid or No Longer Set" errors in my Access 2002 mdb. What causes these errors? Has anyone dealt with this before? I can't trace it because it's not easy to duplicate -- it just show up... I've heard that spurious queries that use Now() or Date() or some other date
1
2138
by: Grey | last post by:
i use "this.Page.RegisterStartupScript()" to display the client-side script of confirmation box ...but I want to know that how can I know the user was clicked "YES" or "NO" as I need to do different action for these two choices. Million Thanks..
5
2555
by: Stan | last post by:
When I create a Web project and then try to add the files to it (Add Existing Item), I get this error message "The folder http://localhost/FinWeb is no longer availabe" In fact the folder and the virtual directory FinWeb both exist and project compiles just fine, but I cannot add the existing files to it. If I create a project with a different name (FinWeb2) it works fine.
9
4847
by: Tristán White | last post by:
Hi I am very new to PHP - actually, this is my second day at it, as I've only recently started a new job last week. We're a charity. I have a "No input file selected" problem. A Google search has shown me that this is a common problem, but I have tried to follow all the various instructions but none of them make any difference. First of all... Some background on the page it links from.....
5
28257
by: balakrishnan.dinesh | last post by:
hi Frnds, I need Confirm box with "yes" or "no" buttons, Is that possible in JAVASCRIPT , Can anyone tell me the solution for this or anyother way to create confirm box with "yes" or "no" button? Thanks & Rgrds Dinesh...
12
3069
by: JHNielson | last post by:
I have a simple question, but I can't seem to find the answer. I have this code to count the number of records that pass through a set of processes: It counts how many records go through INPUT, VALIDATED, ERRORS This is the code to get the numbers: Function Val_Message()
7
4846
by: EManning | last post by:
Using A2003. I'm receiving this error when returning from a "DoCmd.OpenReport..." statement. I have a tab control with a subform on every tab. The user selects an item from a combobox at the top of the main form which refreshes all the subforms. If this DoCmd statement is not executed, then I don't receive the error. I tried a "DoCmd.OpenQuery..." instead of a report but get the same error. I want the user to be able to...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10436
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.