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

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

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,136,366
Messages
5,675,351
Members
419,563
Latest member
blairtab

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