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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
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.
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

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
Back
Top