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_DLMP].SetFocus
Forms![Main_Menu]![Main_DLMP].Form.Visible = True
Forms![Main_Menu]![Main_DeptView].Form.Visible = False
This is the event on the second lablel
Forms![Main_Menu].[Main_DeptView].SetFocus
Forms![Main_Menu]![Main_DeptView].Form.Visible = True
Forms![Main_Menu]![Main_DLMP].Form.Visible = False
I am getting an error on the second label... Cannot set focus.
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
Normally Labels don't need Focus...
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
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