Joy Gomez
asked on
Subform visibility
Hello,
I have a main form (Main_Menu) and 2 sub forms (Main_DLMP and Main_DeptView). In the main menu I have 2 labels that act as menu. I have click events on both these labels. I want to make one visible, and the other not visible. But I struggling with this. These are the 2 events I have for each of the labels in my main form.
This is the event on the first label. As default Main_DLMP visibility is set to True and DLMP_DeptView is set to False.
Forms![Main_Menu].[Main_DL MP].SetFoc us
Forms![Main_Menu]![Main_DL MP].Form.V isible = True
Forms![Main_Menu]![Main_De ptView].Fo rm.Visible = False
This is the event on the second lablel
Forms![Main_Menu].[Main_De ptView].Se tFocus
Forms![Main_Menu]![Main_De ptView].Fo rm.Visible = True
Forms![Main_Menu]![Main_DL MP].Form.V isible = False
I am getting an error on the second label... Cannot set focus.
I have a main form (Main_Menu) and 2 sub forms (Main_DLMP and Main_DeptView). In the main menu I have 2 labels that act as menu. I have click events on both these labels. I want to make one visible, and the other not visible. But I struggling with this. These are the 2 events I have for each of the labels in my main form.
This is the event on the first label. As default Main_DLMP visibility is set to True and DLMP_DeptView is set to False.
Forms![Main_Menu].[Main_DL
Forms![Main_Menu]![Main_DL
Forms![Main_Menu]![Main_De
This is the event on the second lablel
Forms![Main_Menu].[Main_De
Forms![Main_Menu]![Main_De
Forms![Main_Menu]![Main_DL
I am getting an error on the second label... Cannot set focus.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Probably i confused Labels with Subforms..
Ok np
On the click event of Labels...
Ok np
On the click event of Labels...
Form_NameOfSubForm1.Visible = Not Form_NameOfSubForm2.Visible
ASKER
Thank you Anders... worked great!
John... thanks for your continuous support.
John... thanks for your continuous support.
What you probably need is that the Labels are unassociated with any controls. To check it just right clicks -->Properties..check if Events are displayed...if its blank ..then the easy way is to make a copy of the Label delete the old Label..rename the New label to match the old name and you should be fine
Also for Visiility
Open in new window