PC Review


Reply
Thread Tools Rate Thread

can visual basic turn off confirmation of action queries

 
 
=?Utf-8?B?d2F5bmVtYg==?=
Guest
Posts: n/a
 
      12th Jun 2005
My compiled Access program requires confirmation of action queries on some
machines but not on others. It's a real nuisance; I need to find some way to
turn it off. I can't find any documentation for how to turn it off in visual
basic.
 
Reply With Quote
 
 
 
 
David C. Holley
Guest
Posts: n/a
 
      12th Jun 2005
DoCmd.SetWarnings

But its an all or nothing deal. It *shouldn't* work sporatically among
machines.

waynemb wrote:
> My compiled Access program requires confirmation of action queries on some
> machines but not on others. It's a real nuisance; I need to find some way to
> turn it off. I can't find any documentation for how to turn it off in visual
> basic.

 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      12th Jun 2005
"David C. Holley" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)
> DoCmd.SetWarnings
>
> But its an all or nothing deal. It *shouldn't* work sporatically among
> machines.
>
> waynemb wrote:
>> My compiled Access program requires confirmation of action queries
>> on some machines but not on others. It's a real nuisance; I need to
>> find some way to turn it off. I can't find any documentation for
>> how to turn it off in visual basic.


Different users may have different setting for the option "Confirm
action queries" (Tools -> Options, Edit/Find tab). I agree, careful use
of SetWarnings should handle the problem. Another approach, which I
favor when possible, is to use the DAO Execute method (usually by code
like "CurrentDB.Execute strQuery, dbFailOnError") instead of
DoCmd.RunSQL or DoCmd.OpenQuery.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
Reply With Quote
 
=?Utf-8?B?d2F5bmVtYg==?=
Guest
Posts: n/a
 
      12th Jun 2005
Hmmm, it looks like SetWarnings does more than turning off action query
warnings, and apparently unlike turning off the warnings from the menu, doing
it with SetWarnings is only good until the macro (or function?) exits. I'd
like to be able to just turn off the action query warnings once when the
program loads and have the result be the same as if the user (who generally
doesn't have access installed) had turned off the action query warnings from
the Options:Edit/Find:Confirm menu he doesn't have.

One would think the runtime module would behave the same on all machines,
but on at least some machines with Access installed the warnings are set to
Off, and on some machines without Access the warnings are set to On.

Thanks for your help.

"David C. Holley" wrote:

> DoCmd.SetWarnings
>
> But its an all or nothing deal. It *shouldn't* work sporatically among
> machines.
>
> waynemb wrote:
> > My compiled Access program requires confirmation of action queries on some
> > machines but not on others. It's a real nuisance; I need to find some way to
> > turn it off. I can't find any documentation for how to turn it off in visual
> > basic.

>

 
Reply With Quote
 
=?Utf-8?B?d2F5bmVtYg==?=
Guest
Posts: n/a
 
      12th Jun 2005
Thanks, I was hoping there would be something that would be a global
equivalent of turning off the warnings in the Edit/Find tab, rather than
having to turn them off every time I run a query from a macro.

"Dirk Goldgar" wrote:

> "David C. Holley" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)
> > DoCmd.SetWarnings
> >
> > But its an all or nothing deal. It *shouldn't* work sporatically among
> > machines.
> >
> > waynemb wrote:
> >> My compiled Access program requires confirmation of action queries
> >> on some machines but not on others. It's a real nuisance; I need to
> >> find some way to turn it off. I can't find any documentation for
> >> how to turn it off in visual basic.

>
> Different users may have different setting for the option "Confirm
> action queries" (Tools -> Options, Edit/Find tab). I agree, careful use
> of SetWarnings should handle the problem. Another approach, which I
> favor when possible, is to use the DAO Execute method (usually by code
> like "CurrentDB.Execute strQuery, dbFailOnError") instead of
> DoCmd.RunSQL or DoCmd.OpenQuery.
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
>
>

 
Reply With Quote
 
Rick Brandt
Guest
Posts: n/a
 
      12th Jun 2005
waynemb wrote:
> Hmmm, it looks like SetWarnings does more than turning off action
> query warnings, and apparently unlike turning off the warnings from
> the menu, doing it with SetWarnings is only good until the macro (or
> function?) exits. I'd like to be able to just turn off the action
> query warnings once when the program loads and have the result be the
> same as if the user (who generally doesn't have access installed) had
> turned off the action query warnings from the
> Options:Edit/Find:Confirm menu he doesn't have.
>
> One would think the runtime module would behave the same on all
> machines, but on at least some machines with Access installed the
> warnings are set to Off, and on some machines without Access the
> warnings are set to On.


If you "execute" your queries instead of "running" them then there is no
confirmation prompt.

CurrentDB.Execute "QueryName", dbFailOnError

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


 
Reply With Quote
 
=?Utf-8?B?d2F5bmVtYg==?=
Guest
Posts: n/a
 
      12th Jun 2005
Thanks, another interesting workaround. Unfortunately most of my queries are
called from macros, and I'd hate to have to go back and turn it all into vb
code. I was hoping that there would be some coding equivalent of just
turning off the confirmations from the menu bar.

"Rick Brandt" wrote:

> waynemb wrote:
> > Hmmm, it looks like SetWarnings does more than turning off action
> > query warnings, and apparently unlike turning off the warnings from
> > the menu, doing it with SetWarnings is only good until the macro (or
> > function?) exits. I'd like to be able to just turn off the action
> > query warnings once when the program loads and have the result be the
> > same as if the user (who generally doesn't have access installed) had
> > turned off the action query warnings from the
> > Options:Edit/Find:Confirm menu he doesn't have.
> >
> > One would think the runtime module would behave the same on all
> > machines, but on at least some machines with Access installed the
> > warnings are set to Off, and on some machines without Access the
> > warnings are set to On.

>
> If you "execute" your queries instead of "running" them then there is no
> confirmation prompt.
>
> CurrentDB.Execute "QueryName", dbFailOnError
>
> --
> I don't check the Email account attached
> to this message. Send instead to...
> RBrandt at Hunter dot com
>
>
>

 
Reply With Quote
 
David C. Holley
Guest
Posts: n/a
 
      12th Jun 2005
Amazing what spending some time in an Irish Pub or better yet a Taverna
will do to jog the memory. I believe that the SetOption method is what
you're looking for. I scanned the Help Topic breifly, but it does
include a mention about Confirming Action Queries. The topic with the
info is entitled 'Set Options From Visual Basic' and includes the
various options and equivalent string values to access the option using
SetOption and GetOption. From there, if you're all macro based, its just
a matter creating an AutoExec macro to call the VBA code that sets the
value.

waynemb wrote:
> Thanks, another interesting workaround. Unfortunately most of my queries are
> called from macros, and I'd hate to have to go back and turn it all into vb
> code. I was hoping that there would be some coding equivalent of just
> turning off the confirmations from the menu bar.
>
> "Rick Brandt" wrote:
>
>
>>waynemb wrote:
>>
>>>Hmmm, it looks like SetWarnings does more than turning off action
>>>query warnings, and apparently unlike turning off the warnings from
>>>the menu, doing it with SetWarnings is only good until the macro (or
>>>function?) exits. I'd like to be able to just turn off the action
>>>query warnings once when the program loads and have the result be the
>>>same as if the user (who generally doesn't have access installed) had
>>>turned off the action query warnings from the
>>>Options:Edit/Find:Confirm menu he doesn't have.
>>>
>>>One would think the runtime module would behave the same on all
>>>machines, but on at least some machines with Access installed the
>>>warnings are set to Off, and on some machines without Access the
>>>warnings are set to On.

>>
>>If you "execute" your queries instead of "running" them then there is no
>>confirmation prompt.
>>
>>CurrentDB.Execute "QueryName", dbFailOnError
>>
>>--
>>I don't check the Email account attached
>>to this message. Send instead to...
>>RBrandt at Hunter dot com
>>
>>
>>

 
Reply With Quote
 
=?Utf-8?B?d2F5bmVtYg==?=
Guest
Posts: n/a
 
      13th Jun 2005
Beautiful; I owe you a pint or two of Guiness, or whatever it is you've been
drinking.

"David C. Holley" wrote:

> Amazing what spending some time in an Irish Pub or better yet a Taverna
> will do to jog the memory. I believe that the SetOption method is what
> you're looking for. I scanned the Help Topic breifly, but it does
> include a mention about Confirming Action Queries. The topic with the
> info is entitled 'Set Options From Visual Basic' and includes the
> various options and equivalent string values to access the option using
> SetOption and GetOption. From there, if you're all macro based, its just
> a matter creating an AutoExec macro to call the VBA code that sets the
> value.
>
> waynemb wrote:
> > Thanks, another interesting workaround. Unfortunately most of my queries are
> > called from macros, and I'd hate to have to go back and turn it all into vb
> > code. I was hoping that there would be some coding equivalent of just
> > turning off the confirmations from the menu bar.
> >
> > "Rick Brandt" wrote:
> >
> >
> >>waynemb wrote:
> >>
> >>>Hmmm, it looks like SetWarnings does more than turning off action
> >>>query warnings, and apparently unlike turning off the warnings from
> >>>the menu, doing it with SetWarnings is only good until the macro (or
> >>>function?) exits. I'd like to be able to just turn off the action
> >>>query warnings once when the program loads and have the result be the
> >>>same as if the user (who generally doesn't have access installed) had
> >>>turned off the action query warnings from the
> >>>Options:Edit/Find:Confirm menu he doesn't have.
> >>>
> >>>One would think the runtime module would behave the same on all
> >>>machines, but on at least some machines with Access installed the
> >>>warnings are set to Off, and on some machines without Access the
> >>>warnings are set to On.
> >>
> >>If you "execute" your queries instead of "running" them then there is no
> >>confirmation prompt.
> >>
> >>CurrentDB.Execute "QueryName", dbFailOnError
> >>
> >>--
> >>I don't check the Email account attached
> >>to this message. Send instead to...
> >>RBrandt at Hunter dot com
> >>
> >>
> >>

>

 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      13th Jun 2005
"David C. Holley" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)
> Amazing what spending some time in an Irish Pub or better yet a
> Taverna will do to jog the memory. I believe that the SetOption
> method is what you're looking for. I scanned the Help Topic breifly,
> but it does include a mention about Confirming Action Queries. The
> topic with the info is entitled 'Set Options From Visual Basic' and
> includes the various options and equivalent string values to access
> the option using SetOption and GetOption. From there, if you're all
> macro based, its just a matter creating an AutoExec macro to call the
> VBA code that sets the value.


You can set options from Visual Basic, all right, but it's a potentially
dangerous and often ill-mannered thing to be doing. A user's personal
preferences as to options, like that of display resolution (which is
another thing that is often asked in these newsgroups), should be
respected by the developer. It's all well and good to say, "I'll just
change these options while my application runs, and then change them
back when it closes." But what happens if the application crashes
without closing properly? The options chosen by the developer, not the
user, remains in place, affecting other applications.

And even if that doesn't happen, the user may be confounded by behavior
in this particular database that is not what they expect. A use who s
familiar with Access and knows how he has set his options may reasonably
expect this application to conform to those options. He may be cavalier
about running delete queries, because he knows he'll have a chance to
undo them if they turn out to delete all records in the table by
mistake. Imagine his shock when he finds that >poof!< the warning he
had counted upon didn't appear.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Turning off Confirmation of record changes/Action queries etc =?Utf-8?B?RW5nZWxz?= Microsoft Access 4 28th Nov 2006 07:30 AM
queries + Visual basic =?Utf-8?B?anVzdGluX3Zhc2tv?= Microsoft Access 3 24th May 2005 09:02 PM
Wrote a macro in visual basic editor, can't get it to repeat the action iomighty Microsoft Excel Misc 8 15th Jun 2004 12:25 AM
Turn off confirmations for action queries =?Utf-8?B?Um9iIExNUw==?= Microsoft Access Queries 2 9th Apr 2004 05:16 PM
Queries in Visual Basic Steve Moody Microsoft Access Forms 1 1st Aug 2003 04:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:33 PM.