I have a database with some employee information. There is a Main Menu that starts when you open the database and it has a bunch of buttons you can click to open other forms and reports. Once you are finished with a form, you can press a button that closes the form and returns you to the Main Menu. All the buttons work fine (using macros) except for one particular button on one form. I have tried using a macro and have now tried using the code listed below. Is this some kind of bug I am unaware of or is there a flaw in this rather simple code?
Private Sub btn_ReturnToMM_Click()
DoCmd.OpenForm "frm_MainMenu"
DoCmd.Maximize
DoCmd.Close ObjectType:=acForm, ObjectName:="frm_Edit Employee Info"
End Sub
BTW - the three steps I want to accomplish are 1) close the active form, 2) open the Main Menu form and 3) maximize the Main Menu form so that it fills the screen.
Like I said, I usually perform this function with a macro associated to the button. Here is what the macro looks like...
CloseWindow
Object Type: Form
Object Name: frm_Edit Employee Info
Save = Yes
OpenForm
Form Name: frm_MainMenu
Window Mode: Dialog
MaximizeWindow
Thanks in advance!
Jeff
Private Sub btn_ReturnToMM_Click()
DoCmd.OpenForm "frm_MainMenu"
DoCmd.Maximize
DoCmd.Close ObjectType:=acForm, ObjectName:="frm_Edit Employee Info"
End Sub
BTW - the three steps I want to accomplish are 1) close the active form, 2) open the Main Menu form and 3) maximize the Main Menu form so that it fills the screen.
Like I said, I usually perform this function with a macro associated to the button. Here is what the macro looks like...
CloseWindow
Object Type: Form
Object Name: frm_Edit Employee Info
Save = Yes
OpenForm
Form Name: frm_MainMenu
Window Mode: Dialog
MaximizeWindow
Thanks in advance!
Jeff