Unanswered: Close active Form and Open a different Form
I am creating a SubForm which will be located in the Page Footer of various Main Forms. The SubForm will contain Command buttons to take the user to different parts of the database.
When the button is clicked, I want to Close the current Form (the name of the current Form will be different and so I cannot specify the actual name of it).
Then I want to Open a new Form (lets call it 'Employee Menu Form').
I wanted to create a Macro (I am a newbie and this seemed to be the easiest way). But the Macro asks me the name fo the Form which i want to Close. As the name of the Form will be different each time, I cannot give it a name and so I cannot make a Macro - shame Can I put "not known" in the Macro?
So I have tried to work in Visual Basic (see below).
Please could someone tell me how to do a simple Macro, or maybe check my code to see which of the below options are "correct" coding??
Thanks ever so much.
Private Sub Close_Form_Click()
On Error GoTo Err_Close_Form_Click
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment: Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010 VB based on my own environment: vb6 sp5 ASP based on my own environment: 5.6 VB-NET based on my own environment started 2007 SQL-2005 based on my own environment started 2008 MYLE YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.
No literally: Me.Parent.Name. In this expression Parent is a property that represents a handle (a pointer) to the parent form and Name is one of its properties.
If you have a form named "MyParentForm" that has a subform named "MySubForm", from MySubForm Me.Parent.Name yields "MyParentForm". Now if you have another form named "MyOtherParentForm" that also has the form MySubForm as subform, this time from MySubForm the value of Me.Parent.Name will be "MyOtherParentForm".