Message box on open

  • Thread starter Thread starter acss
  • Start date Start date
A

acss

Is there a way to place code on a form so a message box appears on open an
promts as yes/no so user can accept or deny?
 
Is there a way to place code on a form so a message box appears on open an
promts as yes/no so user can accept or deny?

Yes, but you should have given a bit more information so my reply
would be specific to your question.
Can accept or deny what?
Then do what?
Where you place the code is determined by what.

Code the form's Open or Load event:
If MsgBox("Do you accept?",vbExclamation + vbYesNo) = vbYes then
' Do the Yes thing here
Else
' Do the No thing here
End If
 
Hi Fredg,
Let me clarify...It would just be a message box like "You have opened new
form"...it would be a reminder or warning to user then they can close message
and continue data entry. Does this help?
 
Hi Fredg,
Let me clarify...It would just be a message box like "You have opened new
form"...it would be a reminder or warning to user then they can close message
and continue data entry. Does this help?

Code the Form's Open event:

If MsgBox("You have opened new form. Continue?",vbExclamation +
vbYesNo) = vbYes then
Else
Cancel = True
End If

The form will open if Yes is clicked, otherwise the form will not
open.
 
Back
Top