Re: Hiding Message Boxes?



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/expert_contributors2.html for contact
info.


"HowardChr" <u33744@uwe> wrote in message news:715734f56a300@xxxxxx
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!



.


Quantcast