Stevehewitt
IS-IT--Management
Hi,
I'm a VBA / Access Developer and have no experience in .net whatso ever, so please bare with me whilst I post stupid questions!
I am trying to create a Message box where the user can select Yes or No. If they click Yes the app closes, No will restore back to the main screen.
The VBA code for this is:
How can I do this in VB .net?
I can create message boxes without any problems, but I just don't know how to act on the results of the input. (E.G. What's the code to close the app when the users click 'Yes'?)
Sorry for the simple question, and I have hunted around the net / FAQ for it but as it's so simple it's not on the web.
Thanks in advance,
Steve.
I'm a VBA / Access Developer and have no experience in .net whatso ever, so please bare with me whilst I post stupid questions!
I am trying to create a Message box where the user can select Yes or No. If they click Yes the app closes, No will restore back to the main screen.
The VBA code for this is:
Code:
Private Sub btnExitApp_Click()
Dim Msg, Style, Title, Response, MyString
Msg = "Are you sure you wish to exit?" ' Define message.
Style = vbYesNo + vbExclamation ' Define buttons.
Title = "Sales Database" ' Define title.
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ' User chose Yes
DoCmd.Exit ' Close App
Else ' User chose No
DoCmd.Restore ' Returns user back to main menu
End If
End Sub
How can I do this in VB .net?
I can create message boxes without any problems, but I just don't know how to act on the results of the input. (E.G. What's the code to close the app when the users click 'Yes'?)
Sorry for the simple question, and I have hunted around the net / FAQ for it but as it's so simple it's not on the web.
Thanks in advance,
Steve.