I have my program set up so that when a button called "Clear" is clicked, it
clears all Yes/No fields from a seperate table. The problem is that when
that button is clicked, it is coming up with 2 seperate message boxes making
sure that is what they want to do. The first one says: "are you sure you
want to run that query", and the second says "You are about to update 1 row".
Is there a way to code this so those message boxes are either automatically
defaulted to Yes, or to have them run on the background? I dont' think my VP
of IT would appriciate having to click 2 more times on each form.
Current code:
DoCmd.OpenQuery ("clear")
Thanks in advance! 5 3876
Hi, Howard.
Is there a way to code this so those message boxes are either
automatically
defaulted to Yes, or to have them run on the background?
Yes. Use the Execute method with the dbFailOnError argument to tell you
when failure occurs (and rollback the transaction), but remain silent
otherwise. Example:
CurrentDb().Execute "UPDATE MyTable SET Col1 = False;", dbFailOnError
HTH.
Gunny
See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"HowardChr" <u33744@uwewrote in message news:715734f56a300@uwe...
>I have my program set up so that when a button called "Clear" is clicked, it
clears all Yes/No fields from a seperate table. The problem is that when
that button is clicked, it is coming up with 2 seperate message boxes
making
sure that is what they want to do. The first one says: "are you sure you
want to run that query", and the second says "You are about to update 1
row".
Is there a way to code this so those message boxes are either
automatically
defaulted to Yes, or to have them run on the background? I dont' think my
VP
of IT would appriciate having to click 2 more times on each form.
Current code:
DoCmd.OpenQuery ("clear")
Thanks in advance!
Use CurrentDb.Execute instead:
CurrentDb.Execute "clear", dbFailOnError
"HowardChr" <u33744@uwewrote in message news:715734f56a300@uwe...
>I have my program set up so that when a button called "Clear" is clicked, it
clears all Yes/No fields from a seperate table. The problem is that when
that button is clicked, it is coming up with 2 seperate message boxes
making
sure that is what they want to do. The first one says: "are you sure you
want to run that query", and the second says "You are about to update 1
row".
Is there a way to code this so those message boxes are either
automatically
defaulted to Yes, or to have them run on the background? I dont' think my
VP
of IT would appriciate having to click 2 more times on each form.
Current code:
DoCmd.OpenQuery ("clear")
Thanks in advance!
Does this go inside my SQL statment, or in the VB code?
UrbanSpaceman wrote:
>Use CurrentDb.Execute instead:
CurrentDb.Execute "clear", dbFailOnError
>>I have my program set up so that when a button called "Clear" is clicked, it
[quoted text clipped - 16 lines]
>> Thanks in advance!
Sorry.. that did work.. Thanks again!
UrbanSpaceman wrote:
>Use CurrentDb.Execute instead:
CurrentDb.Execute "clear", dbFailOnError
>>I have my program set up so that when a button called "Clear" is clicked, it
[quoted text clipped - 16 lines]
>> Thanks in advance!
HowardChr wrote:
Sorry.. that did work.. Thanks again!
UrbanSpaceman wrote:
Use CurrentDb.Execute instead:
CurrentDb.Execute "clear", dbFailOnError
>I have my program set up so that when a button called "Clear" is clicked, it
[quoted text clipped - 16 lines]
>
Thanks in advance!
You are getting confirmation messages about an action query. You can
turn off the confirmation: Tools>Options>Edit/Find, then uncheck the
Confirm>Action Queries checkbox. I prefer to leave it checked and
turn the confirmation off in code: Just before the action query, use
"Docmd.SetWarnings False" Just after the action query, use
"Docmd.SetWarnings True" . This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Varad |
last post by:
Hi all
I have been fighting to get this working.. I have a form with several text
boxes which posts back when an user fills and submits. I want to hide the
textboxes on postback and display some...
|
by: Chris Sharman |
last post by:
I've got 3 'alternative' boxes, only one of which I want displayed,
according to the value of an earlier select (so I'm using the
<htmlelement>.style property from javascript).
One is a div...
|
by: MN |
last post by:
Greetings to all -
I'm having some fits with getting this to work but I'm near the end and I'm
hoping this one obstacle is not a huge one to get past.
Here's my scenario:
I have a page...
|
by: Tim Graichen |
last post by:
I currently have a form with several combo boxes. I have the background
properties and boarder properties of all form fields set as transparent.
Therefore, the only part of the controls that are...
|
by: Frank K. |
last post by:
Hello,
Hoping someone can help me out.
When I select all records in a table, copy them to the clip board, and paste
them to Excel the names of the fields appear in the first row in Excel....
|
by: Mark Reed |
last post by:
Hi all,
Access 2002 XP platform.
I am trying to learn a little about programming (I know next to nothing
so far) and have found some code which hides the toolbars. However, this bit
of code is a...
|
by: sandy_carraggi |
last post by:
I have a web form that has a formview on it. Within the edit
template, I have a drop down list and two text boxes along with an
image. The drop down list is bound to a SQL Data Source and the...
|
by: Sh4wn |
last post by:
Hi,
first, python is one of my fav languages, and i'll definitely keep
developing with it. But, there's 1 one thing what I -really- miss:
data hiding. I know member vars are private when you...
|
by: Malinmore |
last post by:
the following works well regarding one select box with one hidden text
box. however I need two unique select boxes with relevant hidden text
boxes that un-hide when the Add New option is selected....
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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,...
|
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...
|
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...
| |