473,398 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Message Box

DS
Where in this code does it say that when you go to delete a message box
pops up. I don't want the message box to pop up. I want to remove it
from his code. Thanks
DS

Private Sub Delete_Product_Click()
On Error GoTo Err_Delete_Product_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_Delete_Product_Click:
Exit Sub

Err_Delete_Product_Click:
MsgBox Err.Description
Resume Exit_Delete_Product_Click

End Sub
Nov 13 '05 #1
6 1814
DS wrote:
Where in this code does it say that when you go to delete a message box
pops up. I don't want the message box to pop up. I want to remove it
from his code. Thanks


It's not what's in the code, it's what's NOT in it. Those messages are
generated by Access by default. If you never want to see them, you can
turn the option off in your preferences. If you just don't want to see
them while your application is running, issue this command:

DoCmd.SetWarnings (False)

before the offending code, and

DoCmd.SetWarnings (True)

afterwards.

Nov 13 '05 #2
DS
John Baker wrote:
DS wrote:
Where in this code does it say that when you go to delete a message
box pops up. I don't want the message box to pop up. I want to remove
it from his code. Thanks

It's not what's in the code, it's what's NOT in it. Those messages are
generated by Access by default. If you never want to see them, you can
turn the option off in your preferences. If you just don't want to see
them while your application is running, issue this command:

DoCmd.SetWarnings (False)

before the offending code, and

DoCmd.SetWarnings (True)

afterwards.

God Bless You.....It works great! I stuck it before and after the other
DoCmds. And it Works.....! Thanks.
DS
Nov 13 '05 #3
DS wrote:
God Bless You.....It works great! I stuck it before and after the other
DoCmds. And it Works.....! Thanks.
DS
DS wrote:
God Bless You.....It works great! I stuck it before and after the other
DoCmds. And it Works.....! Thanks.
DS


Be careful, though. If something does happen in the offending code
before you get to docmd.setwarnings true, and you don't have this
trapped in an on error procedure, then you could be in trouble.

Perhaps a better way is to deal with the confirmation message itself.

This is happening on a form, right? And the form is bound to a table?

Here's a good way to find out what is happening.

In your form properties is an event called "Before Delete Confirm".
Click the builder button and go to the VBA window and type in the following:

Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)

'No confirmation message on delete, so set response to:

Response = acDataErrContinue

End Sub

This is a much, much safer way of doing this. It is a good idea to
avoid docmd.setwarnings false and there are a lot of alternative ways
for various procedures to ensure no confirmation messages or other
events occur.

--
Tim - http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #4
DS
Tim Marshall wrote:
DS wrote:
God Bless You.....It works great! I stuck it before and after the
other DoCmds. And it Works.....! Thanks.
DS

DS wrote:
> God Bless You.....It works great! I stuck it before and after the other
> DoCmds. And it Works.....! Thanks.
> DS


Be careful, though. If something does happen in the offending code
before you get to docmd.setwarnings true, and you don't have this
trapped in an on error procedure, then you could be in trouble.

Perhaps a better way is to deal with the confirmation message itself.

This is happening on a form, right? And the form is bound to a table?

Here's a good way to find out what is happening.

In your form properties is an event called "Before Delete Confirm".
Click the builder button and go to the VBA window and type in the
following:

Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)

'No confirmation message on delete, so set response to:

Response = acDataErrContinue

End Sub

This is a much, much safer way of doing this. It is a good idea to
avoid docmd.setwarnings false and there are a lot of alternative ways
for various procedures to ensure no confirmation messages or other
events occur.

Thanks, I'll give it a try.
DS
Nov 13 '05 #5
Tim Marshall wrote:
This is a much, much safer way of doing this. It is a good idea to
avoid docmd.setwarnings false


It would be a bad idea to set warnings to false when your application
starts and set it back to true when it exits.

But if you have any idea whatsoever what is going on during the
statements you're wrapping with the setwarning commands, there is
nothing "dangerous" about using them.

I submit that if you do not know what is going during the statements
that you would be wrapping them with, that *anything* you do while
coding is going to be dangerous.

Nov 13 '05 #6
John Baker wrote:
Tim Marshall wrote:
This is a much, much safer way of doing this. It is a good idea to
avoid docmd.setwarnings false

It would be a bad idea to set warnings to false when your application
starts and set it back to true when it exits.

But if you have any idea whatsoever what is going on during the
statements you're wrapping with the setwarning commands, there is
nothing "dangerous" about using them.

I submit that if you do not know what is going during the statements
that you would be wrapping them with, that *anything* you do while
coding is going to be dangerous.


Nobody knows, because if an error occurs in an action query for
instance, you won't know about it because the warnings have been turned off.

In that instance, best to use ADO/DAO .Execute and (DAO) dbFailOnError
and wrap in a transaction.

In the OP's case, what I would do is use a delete query to delete the
current record then requery the form. I do this myself primarily because
I use SQL Server on the back end and it's the only way to get a
meaningful error message when it goes pear shaped.
--
Pretentious? Moi?
Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Hugh Welford | last post by:
Hi Using WIN XP and FP2000 Using CDO.message to out put a message from my site, I get the following error message 8004020f from using the code:- strsql = "SELECT * FROM details WHERE patid...
8
by: Brian Keating EI9FXB | last post by:
Would I be correct in saying that the only way to get a user message into a Windows form would be to use P/Invoke with Message? Of is there some part of the .NET API that I am totally un aware...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
2
by: Microsoft News | last post by:
What I have is a message box that pops up. It is another browser window. The code is a general function that you pass message, title and a key to. The box works great except, that if you are on a...
0
by: ronscottlangham | last post by:
I am working on a custom WCF EndpoingBehavior that will modify the messages coming in and out of my Service. I am having an error related to the modification of the message in the...
2
by: =?Utf-8?B?QWRl?= | last post by:
HI All, I am encountering the following error when I try to send an email through a SMTP server. I believe the problem lies with the authentication part when the network crednetials are used,...
3
by: Steven Allport | last post by:
I am working on processing eml email message using the email module (python 2.5), on files exported from an Outlook PST file, to extract the composite parts of the email. In most instances this...
0
by: Philluminati | last post by:
I have a Perl SOAP Server which returns this SOAP Message when invoked: <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance"...
2
by: bernd | last post by:
Hi netties, posted this in a different group already, which seems to be inappropriate. I create a message queue with msgget(), sent a 5-byte message to it with msgsnd() and try to receive the...
2
by: forums_mp | last post by:
Facing a design problem here and I'm not sure how to solve this. The system consists of bi-directional communication between a subject communicating with two (at least for now ) listeners. ...
0
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.