How turn turn off warnings

I have a form which contains a button to run an update query. When 
clicking the button, it warns of running an update query to which one 
must respond "Yes". Then it informs you that it is going to update x 
number of records to which one must again respond "Yes". I have used 
macros in the past to turn off and then back on these warnings, but 
lately I have tried to write the code instead of macros. What would be 
the code for this?
For reference, this is what I have right now:

Private Sub UpdateMPS_Button_Click()
On Error GoTo Err_UpdateMPS_Button_Click

     Dim stDocName As String

     stDocName = "qryTotalHours_WorkCenters_Update"
     DoCmd.OpenQuery stDocName, acNormal, acEdit
     Me.Requery

Exit_UpdateMPS_Button_Click:
     Exit Sub

Err_UpdateMPS_Button_Click:
     MsgBox Err.Description
     Resume Exit_UpdateMPS_Button_Click

End Sub

Thanks much,
Darrell
0
Darrell
6/27/2007 1:27:28 PM
access.forms 6864 articles. 2 followers. Follow

5 Replies
1481 Views

Similar Articles

[PageSpeed] 19

Private Sub UpdateMPS_Button_Click()
On Error GoTo Err_UpdateMPS_Button_Click

Dim qdfUpdate As DAO.QueryDef
Dim stDocName As String

     stDocName = "qryTotalHours_WorkCenters_Update"
     Set qdfUpdate = CurrentDb.QueryDefs(stDocName)
     qdfUpdate.Execute dbFailOnError
     Me.Requery

Exit_UpdateMPS_Button_Click:
     Exit Sub

Err_UpdateMPS_Button_Click:
     MsgBox Err.Description
     Resume Exit_UpdateMPS_Button_Click

End Sub

This assumes you've already got a reference set to DAO. (By default, Access 
2000 and 2002 don't). Go to Tools | References while in the VB Editor and 
check. If you don't, scroll through the list of available references until 
you find the one for Microsoft DAO 3.6 Object Library, select it, then close 
the dialog.

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Darrell Childress" <drc_NO@drcSPAMfire.com> wrote in message 
news:468268b9$0$18244$baae4c71@news.mindlink.net...
>I have a form which contains a button to run an update query. When clicking 
>the button, it warns of running an update query to which one must respond 
>"Yes". Then it informs you that it is going to update x number of records 
>to which one must again respond "Yes". I have used macros in the past to 
>turn off and then back on these warnings, but lately I have tried to write 
>the code instead of macros. What would be the code for this?
> For reference, this is what I have right now:
>
> Private Sub UpdateMPS_Button_Click()
> On Error GoTo Err_UpdateMPS_Button_Click
>
>     Dim stDocName As String
>
>     stDocName = "qryTotalHours_WorkCenters_Update"
>     DoCmd.OpenQuery stDocName, acNormal, acEdit
>     Me.Requery
>
> Exit_UpdateMPS_Button_Click:
>     Exit Sub
>
> Err_UpdateMPS_Button_Click:
>     MsgBox Err.Description
>     Resume Exit_UpdateMPS_Button_Click
>
> End Sub
>
> Thanks much,
> Darrell 


0
Douglas
6/27/2007 1:47:32 PM
There are two solutions to the problem.  One is to use SetWarnings to turn 
them on and off.

To turn them off:
Docmd.SetWarnings False
To turn them on:
Docmd.SetWarnings True

But, for action queries, there is a better method.  It is much faster 
because it does not go through the Access UI, it goes directly to Jet and 
therefore, does not trigger the messages.  Replace these lines:

     Dim stDocName As String

     stDocName = "qryTotalHours_WorkCenters_Update"
     DoCmd.OpenQuery stDocName, acNormal, acEdit

With:

    CurrentDb.Execute("qryTotalHours_WorkCenters_Update"), dbFailOnError

Note, the dbFailOnError option is important.  If you do not include it and 
an error occurs, you will not get an error message.
-- 
Dave Hargis, Microsoft Access MVP


"Darrell Childress" wrote:

> I have a form which contains a button to run an update query. When 
> clicking the button, it warns of running an update query to which one 
> must respond "Yes". Then it informs you that it is going to update x 
> number of records to which one must again respond "Yes". I have used 
> macros in the past to turn off and then back on these warnings, but 
> lately I have tried to write the code instead of macros. What would be 
> the code for this?
> For reference, this is what I have right now:
> 
> Private Sub UpdateMPS_Button_Click()
> On Error GoTo Err_UpdateMPS_Button_Click
> 
>      Dim stDocName As String
> 
>      stDocName = "qryTotalHours_WorkCenters_Update"
>      DoCmd.OpenQuery stDocName, acNormal, acEdit
>      Me.Requery
> 
> Exit_UpdateMPS_Button_Click:
>      Exit Sub
> 
> Err_UpdateMPS_Button_Click:
>      MsgBox Err.Description
>      Resume Exit_UpdateMPS_Button_Click
> 
> End Sub
> 
> Thanks much,
> Darrell
> 
0
Utf
6/27/2007 1:58:01 PM
I don't think that this is reliable enough for real world usage

I've had problems doing this




"Klatuu" <Klatuu@discussions.microsoft.com> wrote in message 
news:1992F046-91EF-47FF-9A01-38894F9FBFF0@microsoft.com...
> There are two solutions to the problem.  One is to use SetWarnings to turn
> them on and off.
>
> To turn them off:
> Docmd.SetWarnings False
> To turn them on:
> Docmd.SetWarnings True
>
> But, for action queries, there is a better method.  It is much faster
> because it does not go through the Access UI, it goes directly to Jet and
> therefore, does not trigger the messages.  Replace these lines:
>
>     Dim stDocName As String
>
>     stDocName = "qryTotalHours_WorkCenters_Update"
>     DoCmd.OpenQuery stDocName, acNormal, acEdit
>
> With:
>
>    CurrentDb.Execute("qryTotalHours_WorkCenters_Update"), dbFailOnError
>
> Note, the dbFailOnError option is important.  If you do not include it and
> an error occurs, you will not get an error message.
> -- 
> Dave Hargis, Microsoft Access MVP
>
>
> "Darrell Childress" wrote:
>
>> I have a form which contains a button to run an update query. When
>> clicking the button, it warns of running an update query to which one
>> must respond "Yes". Then it informs you that it is going to update x
>> number of records to which one must again respond "Yes". I have used
>> macros in the past to turn off and then back on these warnings, but
>> lately I have tried to write the code instead of macros. What would be
>> the code for this?
>> For reference, this is what I have right now:
>>
>> Private Sub UpdateMPS_Button_Click()
>> On Error GoTo Err_UpdateMPS_Button_Click
>>
>>      Dim stDocName As String
>>
>>      stDocName = "qryTotalHours_WorkCenters_Update"
>>      DoCmd.OpenQuery stDocName, acNormal, acEdit
>>      Me.Requery
>>
>> Exit_UpdateMPS_Button_Click:
>>      Exit Sub
>>
>> Err_UpdateMPS_Button_Click:
>>      MsgBox Err.Description
>>      Resume Exit_UpdateMPS_Button_Click
>>
>> End Sub
>>
>> Thanks much,
>> Darrell
>> 

0
Tom
6/27/2007 2:10:42 PM
Which are you objecting to?
If it is the Execute method, your fears are unfounded.  It is a much better 
and faster solution than any of the others.
-- 
Dave Hargis, Microsoft Access MVP


"Tom Wannabe" wrote:

> I don't think that this is reliable enough for real world usage
> 
> I've had problems doing this
> 
> 
> 
> 
> "Klatuu" <Klatuu@discussions.microsoft.com> wrote in message 
> news:1992F046-91EF-47FF-9A01-38894F9FBFF0@microsoft.com...
> > There are two solutions to the problem.  One is to use SetWarnings to turn
> > them on and off.
> >
> > To turn them off:
> > Docmd.SetWarnings False
> > To turn them on:
> > Docmd.SetWarnings True
> >
> > But, for action queries, there is a better method.  It is much faster
> > because it does not go through the Access UI, it goes directly to Jet and
> > therefore, does not trigger the messages.  Replace these lines:
> >
> >     Dim stDocName As String
> >
> >     stDocName = "qryTotalHours_WorkCenters_Update"
> >     DoCmd.OpenQuery stDocName, acNormal, acEdit
> >
> > With:
> >
> >    CurrentDb.Execute("qryTotalHours_WorkCenters_Update"), dbFailOnError
> >
> > Note, the dbFailOnError option is important.  If you do not include it and
> > an error occurs, you will not get an error message.
> > -- 
> > Dave Hargis, Microsoft Access MVP
> >
> >
> > "Darrell Childress" wrote:
> >
> >> I have a form which contains a button to run an update query. When
> >> clicking the button, it warns of running an update query to which one
> >> must respond "Yes". Then it informs you that it is going to update x
> >> number of records to which one must again respond "Yes". I have used
> >> macros in the past to turn off and then back on these warnings, but
> >> lately I have tried to write the code instead of macros. What would be
> >> the code for this?
> >> For reference, this is what I have right now:
> >>
> >> Private Sub UpdateMPS_Button_Click()
> >> On Error GoTo Err_UpdateMPS_Button_Click
> >>
> >>      Dim stDocName As String
> >>
> >>      stDocName = "qryTotalHours_WorkCenters_Update"
> >>      DoCmd.OpenQuery stDocName, acNormal, acEdit
> >>      Me.Requery
> >>
> >> Exit_UpdateMPS_Button_Click:
> >>      Exit Sub
> >>
> >> Err_UpdateMPS_Button_Click:
> >>      MsgBox Err.Description
> >>      Resume Exit_UpdateMPS_Button_Click
> >>
> >> End Sub
> >>
> >> Thanks much,
> >> Darrell
> >> 
> 
> 
0
Utf
6/27/2007 2:44:00 PM
I tried the first solution and it works great. I think I will try the 
2nd solution and see how that works.
Thanks for the help,
Darrell

Klatuu wrote:
> Which are you objecting to?
> If it is the Execute method, your fears are unfounded.  It is a much better 
> and faster solution than any of the others.
0
Darrell
7/2/2007 2:11:39 PM
Reply:

Similar Artilces:

reading pane keeps turning on and preview pane keeps turning off
I've been using outlook 2007 for about 6 months and all has been ok until now. My normal view is to have the reading pane turned off and the preview pane turned on. however, now things changed all of a sudden. now when ever I go to the inbox the reading pane is turned on and the preview pane is turned off. So I go to the view menu and reset the view to what it should be. if I click on any other folder such as sent items and back to the inbox, its back to reading pane on and preview pane off. This is the same behavior for all folders. any ideas how to resolve this? Thanks. -- ...

How do you turn off autoformatting?
I am making a spreadsheet that is essentially a record. In one of the cells, I am entering the old/new values for something as 4/80, which Excel instantly turns into April-80. I can format the the cell back to General, but the number that results is not 4/80. And if I go in and reset it to 4/80 again, the autoformatting kicks in again and the whole process starts over. While there are plenty of ways I could work around this, from changing the way I enter the data on up, it has become a sort of matter of honor now. How the heck do I stop Excel from overriding everything I enter? -- nickt --...

how to turn off automatic format in Excel?
Hi Excel automatically change the first character in a cell to be uppercase. I just want lowercase. How can I turn off this function? Thanks Ngoc Hi Go to Tools / Autocorrect and uncheck Capitalize first letter of sentence. Andy. "ngoc" <linh@chello.no> wrote in message news:BOKNb.271$O41.819@amstwist00... > Hi > Excel automatically change the first character in a cell to be > uppercase. I just want lowercase. How can I turn off this function? > Thanks > Ngoc > ...

How do I stop bullet letter (a, b, c) from turning greek?
When I create a document in which I have used letters for bulletted lists (ie, a), b), c) etc), when I print or reopen it, the letters have changed to Greek characters alpha, beta etc. How can I stop this from happening? Thanks very much. Wow, I cannot duplicate this in any version of Publisher. Maybe you are using a different type font. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "allythegeek" <allythegeek@discussions.microsoft.com> wrote in message news:C3FD4415-6A6E-4EA1-97BD-0FF22ADFBB5A@microsoft.com... &...

Preview Pane turns itself back on
I've asked everyone to disable preview pane and I have one user who tells me that everytime she disables it, it turns itself back on. She can disable it in the inbox, go to sent mail folder, return to inbox and it's back on. Help! ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ ...

Exchane E-TUrn Configuration
Hi. Can anyone please point me in the direction of a document that details the configuration of two exchange servers in different active directory domains where one must receive mails for a specific domain and park them and the other dials-up every hour and retrieves these mails? I believe I have to use E-turn for this? Thanks you ...

Turn off Client message server side
I need to turn off client message about the status of the exchange servers on the server aide. Is that possible? We have users how gets messages through the day about the exchange server. Can I turn this off server side? Which message is this? On Fri, 8 Apr 2005 11:40:17 -0500, "AJ" <ajohnso9@jcpenney.com> wrote: >I need to turn off client message about the status of the exchange servers >on the server aide. Is that possible? We have users how gets messages >through the day about the exchange server. Can I turn this off server side? > > ...

Warning message
Hello. I am trying to personalize my Outlook to avoid sending useless e-mails. For instance, since I have no knowledge of Visual Basic, I have found on the web the following script to avoid sending e-mails with no subject: Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim strSubject As String strSubject = Item.Subject If Len(strSubject) = 0 Then Prompt$ = "Subject not present, continue?" If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for Subject") = vbNo Then Cancel = True End If End If End Sub It wo...

How turn turn off warnings
I have a form which contains a button to run an update query. When clicking the button, it warns of running an update query to which one must respond "Yes". Then it informs you that it is going to update x number of records to which one must again respond "Yes". I have used macros in the past to turn off and then back on these warnings, but lately I have tried to write the code instead of macros. What would be the code for this? For reference, this is what I have right now: Private Sub UpdateMPS_Button_Click() On Error GoTo Err_UpdateMPS_Button_Click Dim stDocN...

How to turn Off and On the pesky Office Assistant?
I want to try to live without the Office Assistant. How can I turn it off? If I find I must have it, how do I turn it back on? Thanks, tmb Right clck the office assistant and select Options. Options that are selected cause the office assistant to display, so the more options you deselect, the less times the little guy will show up. You will probably want to leave "REspond to F1 Key" selected (checked), so that you know you can always recall office assistant by pressing F1. Judy Freed "tmb" <topmailbox@yahoo.com> wrote in message news:MLfLb.219948$%h4.209554...

Outlook is running in the background. How do I turn it off?
Outlook is running in the bckground. Don't know why or how. How do I stop it? Some common reasons why Outlook will not shut down completely when you click either the X or Exit: 1. PDA synchronization software with your PDA in the cradle. (activesync, iTunes, etc.) 2. WinFax Pro (especially 10.02 in Outlook 2003) - contact their support for an alleged fix. 3. Franklin-Covey Plan Plus! 4. COM Add-ins. 5. Mail reminder add-ins that keep a stub of Outlook open in the background to check for new mail and fire reminders. 6. Anti-virus/firewall programs that are set to scan i...

Turn on!
As known to us, Exchange 2003 SP2 support enhanced SenderID. How can I turn on SPFResult(apposing Urgency,SenderID,SCL and so on)on the top bar of Outlook 2003? Thanks a lot! KejiaLi,coming from Beijing,China ...

Credit Card EDC Warning
There needs to be a message in RMS Manager that pops up when your setting up or changing tender types that happens when one chooses the Detail Type of Credit Card. A message should pop up telling you that if you are processing credit cards through RMS to make sure that you check the check box "verify via EDC". You could even go so far as to have a message pop up at the end of a credit card sale telling the cashier that their is not an approval code and either require them to key one in or to only click ok. This could also be added to the options under configuration in the Man...

Outlook Attachment bloking
How to Turn Off the Outlook 2000 E-mail Attachment Security Update ? Is the the file with all "Unsafe" extentions ? Is it a REGISTRY KEY ? I use Exchange Server 5.5 - Outlook on front end I need to be able to open some extention - Outlook blokes the "unsafe" files attached. Old version of Outlook DO allow atachments, new, with sp3 (sp2, sp1) do block it automaticaly ! How do I change it ? Thank you, Gon http://www.slipstick.com/outlook/esecup/getexe.htm "gon" <stafing123@yahoo.com> wrote in message news:0c7201c3db8b$bac3b130$a501280a@...

warning when sending big attachment
hello is there a possibility to show a user a warning, when he sends an email with a big attachment? the user should then be able to cancel sending the mail or anyway send the mail. is there an option in outlook (2002/2003) or exchange (2003) for this feature? or know somebody an tool which can perform this task? thank you for helping me Roalnd Doerig <roland.doerig@xerxes.ch> wrote: > is there a possibility to show a user a warning, when he sends an > email with a big attachment? the user should then be able to cancel > sending the mail or anyway send the mail. I ca...

Turning off read receipts once turned on
In Outlook 2000 (configured for CW), the first time an e- mail is opened with a read receipt request, you have a pop-up option to sned a receipt everytime you get a read receipt request. If this is turned on, how can you turn it back off? Going into the Tools>Options>E-mail Options>Tracking Options does not allow you to change your preference once you have accepted read receipts. Neither does reinstalling office. Any suggestions? ...

Turn Over Report
I am not an Accountant or Inventory Manager, how would I interpret or what should I be looking for when I read a Turn Over Report? What are the benefits? Where does the Number Of Receipts (are adjustments included?), Quantity Received YTD, Average Inventory, Quantity Sold YTD Number Of Turns YTD, Annual Turns derive from? "tstrop" wrote: > I am not an Accountant or Inventory Manager, how would I interpret or what > should I be looking for when I read a Turn Over Report? What are the benefits? The turnover report reports the number of times your inventory is replaced, ...

vista 64-bit IE Security Warning
My laptop has been fine with IE until this morning when the Internet Security Warning started coming up on every single webpage at least three times. I do have a picture, but I'll also type what it says. -------------------------------------------------------------------------- Internet Explorer Security (blue taskbar) A website wants to open web content using this program on your computer. This program will open outside of Protected Mode. Internet Explorer's Protected Mode helps protect your computer. If you do not trust this website, do not open this program. NAME...

C4071 warning goes unnoticed in Release build
Hi all, I've just found a C4071 warning (Potentially uninitialized local variable 'name' used) in my code. The funny thing is that in release mode it doesn't show up. The doc says it's a level 4 warning, but I have my level warning set to 4 in both debug and release. Is there any reason why the compiler wouldn't give the warning in release mode (like because of the optimizations, or something)? Thanks Mikel PS: I'm going to fix it right now. >I've just found a C4071 warning (Potentially uninitialized local >variable 'name' used) in my code. The...

How do i turn it off
Hi, Im using office 2003 and if a click and hold the left mouse button an move the cursor out of the cell and release the mouse button the cell stay highlighted and follow me around the worksheet. Is there anyway to change this so that when i release the mouse butto the cells de-highligh -- ceem ----------------------------------------------------------------------- ceemo's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1065 View this thread: http://www.excelforum.com/showthread.php?threadid=37384 Does it work properly if you release the mouse button, and th...

turn off mirror
Hi - I'm trying to create a duplex business card but any changes made to the text are being 'mirrored' or repeated on the 1st page. Both sides need to have different info on them. Does anyone know how to stop Pub. from mirroring ? .. thanks Interesting!!! What version of Publisher are you using? -- >-----Original Message----- >Interesting!!! > >What version of Publisher are you using? > >-- >Pub 2000 > >. > Yeah, read/search the HELP file and it will tell you how to turn off the Synchronising in Publisher 2000. That feature was only in P...

Posting Reports in Manufacturing-How to turn off
In regular dynamic V10, you can go to the posting options and turn off the printing (and get rid of the box asking where to send report) Where do you do the same in manufacturing? For example after a MO receipt, we do not want to print OR be asked to print a report. Right now we have to click cancel like 3 times. thanks! -- Doug Those are actually Inventory reports. Look at the report titles and then go to inventory and turn off the reports there. -- Richard L. Whaley Author / Consultant / MVP Documentation for Software Users Get our Free Tips and Tricks Newsletter and check ou...

How do I turn off the caps lock on a form?
Hi - I added a new field to my Form, but the default for the form seems to be only CAPS. I need this new filed to have both upper and lower case letters (as well as numbers). Thanks Hi Linda, Where are you seeing only CAPS? If the new control is a textbox, when the user types in the textbox, does the entry format as all caps? Are you seeing caps in design view of the form? Jeanette Cunningham "Linda Davies" <Linda Davies@discussions.microsoft.com> wrote in message news:2AB3DB52-2D7B-4272-884A-63D37E94E8A9@microsoft.com... > Hi - I added a new field to my Form, but ...

turn off sync
how do i turn off ALL syncronization functions in Outlook. i turned it on, don't like it, and now i can't turn it off. someone please help. thanks. Please tell us your version and what you're syncing with. stanc@lsil.com wrote: > how do i turn off ALL syncronization functions in > Outlook. i turned it on, don't like it, and now i can't > turn it off. > someone please help. > thanks. ...

Reminder that is turned off by meeting originator gets turned back on by recepients
Hi all, We are using Outlook 2007/Exchange 2007 and have came across a item of question. We have noticed that when a calendar entry is created and sent to a group of people, that the reminder setting does not get propagated. For instance, when the originator turns off the reminder and sends the notice out, it is received with the reminder turned on. I looked at the Outlook help and didn't see anything addressing this behavior. Any ideas why this is happening this way? Thanks Pete It's a bug in Exchange server. http://support.microsoft.com/defa...