code for message box

  • Thread starter Thread starter NAS
  • Start date Start date
N

NAS

This is a pretty simple question but can someone show me the VB code for a
cancel button. I alredy have it as far as showing the message box when you
click cancel thats says "are you sure?" and it has yes or no as an option. I
need the code that closes both forms if yes, and closes the message box if no.
 
NO, I DO NOT WANT YOU TO BUILD A DATABASE FOR ME FOR A "REASONABLE FEE".

Okay, but if you want a database built for an exorbinate feelthe doesn't
work very well, call Steve :)

If MsgBox("Do you eant to close the Forms", vbQuestion + vbYesNo +
vbDefaultButtonTwo) = vbYes Then
Docmd.Close("FirstForm")
Docmd.Close("OtherForm")
End If

The message box will close either way once you click a button.
 

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

Back
Top