Action confirmation

H

Howard

Hi!
I have a command button which is going to change a status field in a table.
I want to make sure that the user meant to click on this button by displaying
an "Are you sure" message. I have the original button open a form with a
label field asking "Are you sure?" and two command buttons for yes and no
replies. Of course the original command button does not wait for the response
in the second form. If I put the code to change the status in an event on the
yes button, it can no longer access the bound record from the original form.
There must be an easy way to do this. Please help.
 
W

Wayne Morgan

To pause the code when opening a "pop-up" form, open the form with the
acDialog window mode argument. The code will pause until the pop-up form is
closed or hidden. However, to just get a Yes or No answer to a question, try
a MsgBox instead.

Example:
If MsgBox("Do you really want to do this?", vbYesNo + vbQuestion, "Please
Confirm") = vbYes Then
'do your stuff here
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top