|
 |
access thread: Delete Record Message
Message #1 by "George Oro" <george@c...> on Tue, 18 Jun 2002 10:23:19 +0400
|
|
Hi Guys,
How can bypass the default Delete Record Message and defined my own?
What I want is, if I click my cmdDelete button it will do something like this:
Private Sub cmdDelete_Click()
dim intMsg as Integer
intMsg=MsgBox("Do you want to delete this information?"),vbQuestion + vbYesNo + vbDefault1,"Delete Record"
If (intMsg=vbNo) then
MsgBox"Operation canceled.",vbInformation, "Delete Record"
Else
'Run my procedure...
End If
End Sub
All tips are highly appreciated...
Cheers,
George ^_^
Message #2 by "enZo :-\)" <enzaux@g...> on Tue, 18 Jun 2002 16:39:57 +0800
|
|
Go to Tools>Options> then go to Edit/Find Tab then on the Confirm Section uncheck Document
Deletions. This will remove the default
message box whenever you delete anything on the database.
Hope this help,
Enzo
-----Original Message-----
From: George Oro [mailto:george@c...]
Sent: Tuesday, June 18, 2002 2:23 PM
To: Access
Subject: [access] Delete Record Message
Hi Guys,
How can bypass the default Delete Record Message and defined my own?
What I want is, if I click my cmdDelete button it will do something like this:
Private Sub cmdDelete_Click()
dim intMsg as Integer
intMsg=MsgBox("Do you want to delete this information?"),vbQuestion + vbYesNo + vbDefault1,"Delete Record"
If (intMsg=vbNo) then
MsgBox"Operation canceled.",vbInformation, "Delete Record"
Else
'Run my procedure...
End If
End Sub
All tips are highly appreciated...
Cheers,
George ^_^
Message #3 by "George Oro" <george@c...> on Tue, 18 Jun 2002 15:28:44 +0400
|
|
Enzo,
I know what you mean which is quite risky in some other objects and data. Actually, I need only this in two of my data entry form to
confirm before deleting records.
Thanks for the tips anyway...
Cheers,
George
-----Original Message-----
From: enZo :-) [mailto:enzaux@g...]
Sent: Tuesday, June 18, 2002 12:40 PM
To: Access
Subject: [access] RE: Delete Record Message
Go to Tools>Options> then go to Edit/Find Tab then on the Confirm Section uncheck Document Deletions. This will remove the
default
message box whenever you delete anything on the database.
Hope this help,
Enzo
-----Original Message-----
From: George Oro [mailto:george@c...]
Sent: Tuesday, June 18, 2002 2:23 PM
To: Access
Subject: [access] Delete Record Message
Hi Guys,
How can bypass the default Delete Record Message and defined my own?
What I want is, if I click my cmdDelete button it will do something like this:
Private Sub cmdDelete_Click()
dim intMsg as Integer
intMsg=MsgBox("Do you want to delete this information?"),vbQuestion + vbYesNo + vbDefault1,"Delete Record"
If (intMsg=vbNo) then
MsgBox"Operation canceled.",vbInformation, "Delete Record"
Else
'Run my procedure...
End If
End Sub
All tips are highly appreciated...
Cheers,
George ^_^
Message #4 by "Amy Wyatt" <amyw@c...> on Tue, 18 Jun 2002 13:25:48
|
|
How are you actually deleting the record? Are you using a delete query? If
you are, you can either set the warnings off before you run the query and
then back on after you run the query, or you can execute the SQL instead
of opening the query to run it and this will not give a warning message.
Let me know if you are deleting in some other way.
Amy
> Enzo,
I know what you mean which is quite risky in some other objects and data.
Actually, I need only this in two of my data entry form to
confirm before deleting records.
Thanks for the tips anyway...
Cheers,
George
-----Original Message-----
From: enZo :-) [mailto:enzaux@g...]
Sent: Tuesday, June 18, 2002 12:40 PM
To: Access
Subject: [access] RE: Delete Record Message
Go to Tools>Options> then go to Edit/Find Tab then on the Confirm Section
uncheck Document Deletions. This will remove the default
message box whenever you delete anything on the database.
Hope this help,
Enzo
-----Original Message-----
From: George Oro [mailto:george@c...]
Sent: Tuesday, June 18, 2002 2:23 PM
To: Access
Subject: [access] Delete Record Message
Hi Guys,
How can bypass the default Delete Record Message and defined my own?
What I want is, if I click my cmdDelete button it will do something like
this:
Private Sub cmdDelete_Click()
dim intMsg as Integer
intMsg=MsgBox("Do you want to delete this information?"),vbQuestion +
vbYesNo + vbDefault1,"Delete Record"
If (intMsg=vbNo) then
MsgBox"Operation canceled.",vbInformation, "Delete Record"
Else
'Run my procedure...
End If
End Sub
All tips are highly appreciated...
Cheers,
George ^_^
Message #5 by "George Oro" <george@c...> on Tue, 18 Jun 2002 16:37:58 +0400
|
|
Amy,
Thanks for your response...
Actually I just used the Command Button Wizard Delete Record to my data entry form and that's it.
Cheers,
George
-----Original Message-----
From: Amy Wyatt [mailto:amyw@c...]
Sent: Tuesday, June 18, 2002 1:26 PM
To: Access
Subject: [access] RE: Delete Record Message
How are you actually deleting the record? Are you using a delete query? If
you are, you can either set the warnings off before you run the query and
then back on after you run the query, or you can execute the SQL instead
of opening the query to run it and this will not give a warning message.
Let me know if you are deleting in some other way.
Amy
> Enzo,
I know what you mean which is quite risky in some other objects and data.
Actually, I need only this in two of my data entry form to
confirm before deleting records.
Thanks for the tips anyway...
Cheers,
George
-----Original Message-----
From: enZo :-) [mailto:enzaux@g...]
Sent: Tuesday, June 18, 2002 12:40 PM
To: Access
Subject: [access] RE: Delete Record Message
Go to Tools>Options> then go to Edit/Find Tab then on the Confirm Section
uncheck Document Deletions. This will remove the default
message box whenever you delete anything on the database.
Hope this help,
Enzo
-----Original Message-----
From: George Oro [mailto:george@c...]
Sent: Tuesday, June 18, 2002 2:23 PM
To: Access
Subject: [access] Delete Record Message
Hi Guys,
How can bypass the default Delete Record Message and defined my own?
What I want is, if I click my cmdDelete button it will do something like
this:
Private Sub cmdDelete_Click()
dim intMsg as Integer
intMsg=MsgBox("Do you want to delete this information?"),vbQuestion +
vbYesNo + vbDefault1,"Delete Record"
If (intMsg=vbNo) then
MsgBox"Operation canceled.",vbInformation, "Delete Record"
Else
'Run my procedure...
End If
End Sub
All tips are highly appreciated...
Cheers,
George ^_^
Message #6 by "Amy Wyatt" <amyw@c...> on Tue, 18 Jun 2002 19:13:16
|
|
Deleting through the Docmd.DoMenuItem method can only be turned off as
mentioned earlier, for the whole database. This is indeed a dangerous
method of preventing the message about deleting a record. You could also
set this up in a Macro with Set Warnings turned off and then turned back
on but in a Macro it is more difficult to confirm that the user wants to
delete the record. I would suggest doing it in a coded function using a
DELETE SQL to accomplish it.
Instead of the docmd.DoMenuItem you need to get the Key ID from the record
the person is on and execute an SQL similar to this:
Dim strCurrID as String
"DELETE * FROM tblOne WHERE ID='" & strCurrID & "'"
... If ID is number then
Dim lngCurrID as Long
"DELETE * FROM tblOne WHERE ID=" & lngCurrID
...then be sure to requery your form so the dreaded #DELETED doesn't show
up for the user.
Hope this helps.
Amy
> Amy,
Thanks for your response...
Actually I just used the Command Button Wizard Delete Record to my data
entry form and that's it.
Cheers,
George
Message #7 by "enZo :-\)" <enzaux@g...> on Wed, 19 Jun 2002 08:39:07 +0800
|
|
Yup right! Do the query (delete) hard coded this will not show any message box confirming the deletion.
Enzo
-----Original Message-----
From: Amy Wyatt [mailto:amyw@c...]
Sent: Tuesday, June 18, 2002 1:26 PM
To: Access
Subject: [access] RE: Delete Record Message
How are you actually deleting the record? Are you using a delete query? If
you are, you can either set the warnings off before you run the query and
then back on after you run the query, or you can execute the SQL instead
of opening the query to run it and this will not give a warning message.
Let me know if you are deleting in some other way.
Amy
> Enzo,
I know what you mean which is quite risky in some other objects and data.
Actually, I need only this in two of my data entry form to
confirm before deleting records.
Thanks for the tips anyway...
Cheers,
George
-----Original Message-----
From: enZo :-) [mailto:enzaux@g...]
Sent: Tuesday, June 18, 2002 12:40 PM
To: Access
Subject: [access] RE: Delete Record Message
Go to Tools>Options> then go to Edit/Find Tab then on the Confirm Section
uncheck Document Deletions. This will remove the default
message box whenever you delete anything on the database.
Hope this help,
Enzo
-----Original Message-----
From: George Oro [mailto:george@c...]
Sent: Tuesday, June 18, 2002 2:23 PM
To: Access
Subject: [access] Delete Record Message
Hi Guys,
How can bypass the default Delete Record Message and defined my own?
What I want is, if I click my cmdDelete button it will do something like
this:
Private Sub cmdDelete_Click()
dim intMsg as Integer
intMsg=MsgBox("Do you want to delete this information?"),vbQuestion +
vbYesNo + vbDefault1,"Delete Record"
If (intMsg=vbNo) then
MsgBox"Operation canceled.",vbInformation, "Delete Record"
Else
'Run my procedure...
End If
End Sub
All tips are highly appreciated...
Cheers,
George ^_^
Message #8 by "George Oro" <george@c...> on Wed, 19 Jun 2002 13:39:28 +0400
|
|
Thanks for the tips Guys, I sorted out already by using BeforeDelele.
Cheers,
George
-----Original Message-----
From: enZo :-) [mailto:enzaux@g...]
Sent: Wednesday, June 19, 2002 4:39 AM
To: Access
Subject: [access] RE: Delete Record Message
Yup right! Do the query (delete) hard coded this will not show any message box confirming the deletion.
Enzo
-----Original Message-----
From: Amy Wyatt [mailto:amyw@c...]
Sent: Tuesday, June 18, 2002 1:26 PM
To: Access
Subject: [access] RE: Delete Record Message
How are you actually deleting the record? Are you using a delete query? If
you are, you can either set the warnings off before you run the query and
then back on after you run the query, or you can execute the SQL instead
of opening the query to run it and this will not give a warning message.
Let me know if you are deleting in some other way.
Amy
> Enzo,
I know what you mean which is quite risky in some other objects and data.
Actually, I need only this in two of my data entry form to
confirm before deleting records.
Thanks for the tips anyway...
Cheers,
George
-----Original Message-----
From: enZo :-) [mailto:enzaux@g...]
Sent: Tuesday, June 18, 2002 12:40 PM
To: Access
Subject: [access] RE: Delete Record Message
Go to Tools>Options> then go to Edit/Find Tab then on the Confirm Section
uncheck Document Deletions. This will remove the default
message box whenever you delete anything on the database.
Hope this help,
Enzo
-----Original Message-----
From: George Oro [mailto:george@c...]
Sent: Tuesday, June 18, 2002 2:23 PM
To: Access
Subject: [access] Delete Record Message
Hi Guys,
How can bypass the default Delete Record Message and defined my own?
What I want is, if I click my cmdDelete button it will do something like
this:
Private Sub cmdDelete_Click()
dim intMsg as Integer
intMsg=MsgBox("Do you want to delete this information?"),vbQuestion +
vbYesNo + vbDefault1,"Delete Record"
If (intMsg=vbNo) then
MsgBox"Operation canceled.",vbInformation, "Delete Record"
Else
'Run my procedure...
End If
End Sub
All tips are highly appreciated...
Cheers,
George ^_^
Message #9 by "Kenny Alligood" <kennyalligood@h...> on Wed, 19 Jun 2002 10:07:33 -0400
|
|
------=_NextPart_001_0001_01C21779.2159A540
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Try adding this to the beginning of your code:
DoCmd.SetWarnings False
Kenny
----- Original Message -----
From: George Oro
Sent: Tuesday, June 18, 2002 2:27 AM
To: Access
Subject: [access] Delete Record Message
Hi Guys,
How can bypass the default Delete Record Message and defined my own?
What I want is, if I click my cmdDelete button it will do something like
this:
Private Sub cmdDelete_Click()
dim intMsg as Integer
intMsg=3DMsgBox("Do you want to delete this information?"),vbQuestion + v
bYesNo + vbDefault1,"Delete Record"
If (intMsg=3DvbNo) then
MsgBox"Operation canceled.",vbInformation, "Delete Record"
Else
'Run my procedure...
End If
End Sub
All tips are highly appreciated...
Cheers,
George ^_^
to unsubscribe send a blank email to G
et more from the Web. FREE MSN Explorer download : http://explorer.msn.c
om
|
|
 |