FantasiaDown
09-05-2003, 10:31 AM
I'm having a problem with a small bit of code that i'm not sure how to finish.
In a application i'm coding that involves the user to Exit a data entry screen (being frmAdd) and return to the Main screen (being frmMain), I
am having problems unloading this Addfrm and then having the Mainfrm show again.The rest of the code works fine - once the user is asked if they would like to exit the entry and they click on the yes btn, the application ends.instead however, i would like the user to just be returned to the main screen.
here is what i have for the code for the cmdExit button for the
Addfrm.
Private Sub cmdExit_Click()
Const conbtns As Integer = vbYesNo + vbExclamation + vbDefaultButton1 + vbApplicationModal
Dim intuserresponse As Integer
intuserresponse = MsgBox("Are You sure you want to exit this entry?", conbtns, "Personal Phone Book")
If intuserresponse = vbYes Then
Unload frmAdd
Load frmMain
End
End If
when i test the application with this code, nothing drastically horrible happens like i fist anticipated.the application just ends when i would like the user to be returned to the main screen. what am i not doing correctly here ?
- as always, all comments and suggestions are gratefully welcome !
thanks for the help.
In a application i'm coding that involves the user to Exit a data entry screen (being frmAdd) and return to the Main screen (being frmMain), I
am having problems unloading this Addfrm and then having the Mainfrm show again.The rest of the code works fine - once the user is asked if they would like to exit the entry and they click on the yes btn, the application ends.instead however, i would like the user to just be returned to the main screen.
here is what i have for the code for the cmdExit button for the
Addfrm.
Private Sub cmdExit_Click()
Const conbtns As Integer = vbYesNo + vbExclamation + vbDefaultButton1 + vbApplicationModal
Dim intuserresponse As Integer
intuserresponse = MsgBox("Are You sure you want to exit this entry?", conbtns, "Personal Phone Book")
If intuserresponse = vbYes Then
Unload frmAdd
Load frmMain
End
End If
when i test the application with this code, nothing drastically horrible happens like i fist anticipated.the application just ends when i would like the user to be returned to the main screen. what am i not doing correctly here ?
- as always, all comments and suggestions are gratefully welcome !
thanks for the help.