warning message box

mamfa

New Member
Joined
Jun 23, 2006
Messages
25
how do i get a message box to come up to warn a user that they are about to delete a record? i want them to be able to click ok or cancel so that they can change their mind, do i need to create a form of is there another way?

thanks
Samantha
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

MyBoo

Board Regular
Joined
Aug 9, 2006
Messages
217
How are you allowing the user to Delete?

If you are using a Command Button to Delete the record, then edit the event and add a MsgBox statement.

Dim Response

Response = MsgBox ("Delete?", vbYesNo)
If Response = 6 then
'your delete command goes here
end if

6 = yes
7 = no

Search HELP on MsgBox for additional formatting and options.
 

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
Hi mamfa,

Normally, if you try to delete one or more records you will get an automatic warning from Access, with OK and Cancel options. Is this what you wanted, or do you want to replace this with something else?

Denis
 

mamfa

New Member
Joined
Jun 23, 2006
Messages
25
hi i like the first idea it suits what i need better however when writing the code when i write the line

6 = yes

it errors and stays red??

am i not getting something
 

MyBoo

Board Regular
Joined
Aug 9, 2006
Messages
217
6 = yes and 7 = no are informational ... not part of the code. Remove
 

Forum statistics

Threads
1,176,395
Messages
5,902,822
Members
434,998
Latest member
BradneedsXcellhelp

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top