473,378 Members | 1,536 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,378 software developers and data experts.

Remove "Yes" "No" Confirmation from Queries

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 6476
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.SetWarnings = false"

Afterwards add "DoCmd.SetWarnings = true"

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

Afterwards add "DoCmd.SetWarnings = true"

I think that's right, but I'm newish.
The DoCmd.SetWarnings = 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
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
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
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 Expert 1GB
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
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...
7
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...
1
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...
5
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...
9
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...
5
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?...
12
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...
7
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...
1
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.