Action confirmation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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