PC Review


Reply
Thread Tools Rate Thread

Disable Pop Up Box

 
 
fishqqq@hotmail.com
Guest
Posts: n/a
 
      25th May 2011
I have a button that basically runs a Delete query but before it
deletes the records it's supposed to it asks the user via a pop up box
if they wish to delete these records.

Can someone please tell me how I disable these pop up boxes as they
will likely confuse the user (who isn't aware part of their action is
deleting records).

I know i can use "Docmd.SetWarnings false " for a form but i don't
know how to use this for a query.

Suggestions are greatly appreciated.

Tks
Steve
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      25th May 2011
On Wed, 25 May 2011 07:51:01 -0700 (PDT), "(E-Mail Removed)"
<(E-Mail Removed)> wrote:

>I have a button that basically runs a Delete query but before it
>deletes the records it's supposed to it asks the user via a pop up box
>if they wish to delete these records.
>
>Can someone please tell me how I disable these pop up boxes as they
>will likely confuse the user (who isn't aware part of their action is
>deleting records).
>
>I know i can use "Docmd.SetWarnings false " for a form but i don't
>know how to use this for a query.
>
>Suggestions are greatly appreciated.
>
>Tks
>Steve


You can use the Execute method to run the query - it doesn't bring up the
warning boxes. Sample code:

Dim db As DAO.Database ' define an object referring to the current database
Set db = CurrentDb
On Error GoTo Proc_Error
db.Execute "MyDeleteQuery", dbFailOnError
Proc_Exit:
Exit Sub
Proc_Error:
MsgBox "Error " & Err.Number & " trying to run delete query" _
& vbCrLf & Err.Description
Resume Proc_Exit
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also http://www.utteraccess.com
 
Reply With Quote
 
fishqqq@hotmail.com
Guest
Posts: n/a
 
      25th May 2011
On May 25, 11:24*am, John W. Vinson
<jvinson@STOP_SPAM.WysardOfInfo.com> wrote:
> On Wed, 25 May 2011 07:51:01 -0700 (PDT), "fish...@hotmail.com"
>
>
>
> <fish...@hotmail.com> wrote:
> >I have a button that basically runs a Delete query but before it
> >deletes the records it's supposed to it asks the user via a pop up box
> >if they wish to delete these records.

>
> >Can someone please tell me how I disable these pop up boxes as they
> >will likely confuse the user (who isn't aware part of their action is
> >deleting records).

>
> >I know i can use "Docmd.SetWarnings false * * *" for a form but i don't
> >know how to use this for a query.

>
> >Suggestions are greatly appreciated.

>
> >Tks
> >Steve

>
> You can use the Execute method to run the query - it doesn't bring up the
> warning boxes. Sample code:
>
> Dim db As DAO.Database ' define an object referring to the current database
> Set db = CurrentDb
> On Error GoTo Proc_Error
> db.Execute "MyDeleteQuery", dbFailOnError
> Proc_Exit:
> * Exit Sub
> Proc_Error:
> * MsgBox "Error " & Err.Number & " trying to run delete query" _
> * * & vbCrLf & Err.Description
> Resume Proc_Exit
> --
>
> * * * * * * *John W. Vinson [MVP]
> *Microsoft's replacements for these newsgroups:
> *http://social.msdn.microsoft.com/For...-US/accessdev/
> *http://social.answers.microsoft.com/.../en-US/addbuz/
> *and see alsohttp://www.utteraccess.com


Thanks John,
i'm not sure I understand what you're saying.
I have a field that has an after update macro attached to it. I was
hoping there was something I could add to the macro to stop the pop up
boxes.

I'm not sure what you mean (or what to do ) with an "execute method".

 
Reply With Quote
 
John Spencer
Guest
Posts: n/a
 
      25th May 2011
You can add Set Warnings False and Set Warnings True to your macro.

HOWEVER, if something goes awry while the macro executes its steps, you will
be in a situation where you will not GET ANY warnings. That is one reason to
use VBA code if you can.


John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

On 5/25/2011 12:16 PM, (E-Mail Removed) wrote:
> On May 25, 11:24 am, John W. Vinson
> <jvinson@STOP_SPAM.WysardOfInfo.com> wrote:
>> On Wed, 25 May 2011 07:51:01 -0700 (PDT), "fish...@hotmail.com"
>>
>>
>>
>> <fish...@hotmail.com> wrote:
>>> I have a button that basically runs a Delete query but before it
>>> deletes the records it's supposed to it asks the user via a pop up box
>>> if they wish to delete these records.

>>
>>> Can someone please tell me how I disable these pop up boxes as they
>>> will likely confuse the user (who isn't aware part of their action is
>>> deleting records).

>>
>>> I know i can use "Docmd.SetWarnings false " for a form but i don't
>>> know how to use this for a query.

>>
>>> Suggestions are greatly appreciated.

>>
>>> Tks
>>> Steve

>>
>> You can use the Execute method to run the query - it doesn't bring up the
>> warning boxes. Sample code:
>>
>> Dim db As DAO.Database ' define an object referring to the current database
>> Set db = CurrentDb
>> On Error GoTo Proc_Error
>> db.Execute "MyDeleteQuery", dbFailOnError
>> Proc_Exit:
>> Exit Sub
>> Proc_Error:
>> MsgBox "Error "& Err.Number& " trying to run delete query" _
>> & vbCrLf& Err.Description
>> Resume Proc_Exit
>> --
>>
>> John W. Vinson [MVP]
>> Microsoft's replacements for these newsgroups:
>> http://social.msdn.microsoft.com/For...-US/accessdev/
>> http://social.answers.microsoft.com/.../en-US/addbuz/
>> and see alsohttp://www.utteraccess.com

>
> Thanks John,
> i'm not sure I understand what you're saying.
> I have a field that has an after update macro attached to it. I was
> hoping there was something I could add to the macro to stop the pop up
> boxes.
>
> I'm not sure what you mean (or what to do ) with an "execute method".
>
>


 
Reply With Quote
 
fishqqq@hotmail.com
Guest
Posts: n/a
 
      26th May 2011
On May 25, 3:15*pm, John Spencer <JSPEN...@Hilltop.umbc> wrote:
> You can add Set Warnings False and Set Warnings True to your macro.
>
> HOWEVER, if something goes awry while the macro executes its steps, you will
> be in a situation where you will not GET ANY warnings. *That is one reason to
> use VBA code if you can.
>
> John Spencer
> Access MVP 2002-2005, 2007-2010
> The Hilltop Institute
> University of Maryland Baltimore County
>
> On 5/25/2011 12:16 PM, fish...@hotmail.com wrote:
>
> > On May 25, 11:24 am, John W. Vinson
> > <jvinson@STOP_SPAM.WysardOfInfo.com> *wrote:
> >> On Wed, 25 May 2011 07:51:01 -0700 (PDT), "fish...@hotmail.com"

>
> >> <fish...@hotmail.com> *wrote:
> >>> I have a button that basically runs a Delete query but before it
> >>> deletes the records it's supposed to it asks the user via a pop up box
> >>> if they wish to delete these records.

>
> >>> Can someone please tell me how I disable these pop up boxes as they
> >>> will likely confuse the user (who isn't aware part of their action is
> >>> deleting records).

>
> >>> I know i can use "Docmd.SetWarnings false * * *" for a form buti don't
> >>> know how to use this for a query.

>
> >>> Suggestions are greatly appreciated.

>
> >>> Tks
> >>> Steve

>
> >> You can use the Execute method to run the query - it doesn't bring up the
> >> warning boxes. Sample code:

>
> >> Dim db As DAO.Database ' define an object referring to the current database
> >> Set db = CurrentDb
> >> On Error GoTo Proc_Error
> >> db.Execute "MyDeleteQuery", dbFailOnError
> >> Proc_Exit:
> >> * *Exit Sub
> >> Proc_Error:
> >> * *MsgBox "Error "& *Err.Number& *" trying to run delete query" _
> >> * * *& *vbCrLf& *Err.Description
> >> Resume Proc_Exit
> >> --

>
> >> * * * * * * * John W. Vinson [MVP]
> >> * Microsoft's replacements for these newsgroups:
> >> *http://social.msdn.microsoft.com/For...-US/accessdev/
> >> *http://social.answers.microsoft.com/.../en-US/addbuz/
> >> * and see alsohttp://www.utteraccess.com

>
> > Thanks John,
> > i'm not sure I understand what you're saying.
> > I have a field that has an after update macro attached to it. I was
> > hoping there was something I could add to the macro to stop the pop up
> > boxes.

>
> > I'm not sure what you mean (or what to do ) with an "execute method".


thanks that works great
 
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
if I disable ssdp with this disable upnp for my router? jim Windows XP Help 2 31st Jan 2007 08:15 AM
Performing something Like Disable / changing the layout of Disable esakal Microsoft C# .NET 0 6th Sep 2006 05:01 PM
Performing something Like Disable / changing the layout of Disable esakal Microsoft Dot NET 0 6th Sep 2006 05:01 PM
Disable Password Prompt/Disable User Lock =?Utf-8?B?SnVsY28=?= Windows XP General 2 25th Aug 2006 02:05 AM
Skin pocket pc, disable hardware buttons, disable start button Tizio Incognito Microsoft Dot NET Compact Framework 1 3rd Feb 2005 09:13 AM


Features
 

Advertising
 

Newsgroups
 


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