Changing Focus

ethan.geerdes

Registered User.
Local time
Today, 13:16
Joined
Jun 4, 2015
Messages
116
I am having trouble setting the focus on my forms... I have a parent form with two labels that are coded like this.

Private Sub Advisory Messages_Click()
Me![ Advisory Messages].Visible = _
Not Me![Advisory Messages].Visible



End Sub

Private Sub Security Updates_Click()
Me![Security Updates].Visible = _
Not Me![Security Updates].Visible

End Sub

I have the visible property set to no on the subform allowing the user to toggle the visibility when the label is clicked. The problem though is when I click inside the subform to use the scroll bar to view records, it transfers the focus to the subform making it almost impossible to close by clicking the label again because the label is on the parent form. I found the "me.parent.setfocus" command and a few other set focus commands but I don't know what I should be applying the command to in order to make it work. Any help would be appreciated.
 
I think your problem is that you can't set focus to a control if its not visible.
 
Ok. Then what script would I need to make it start off as invisible then? I'm just trying to keep my form as clean as possible and I figured tabs that toggled the view of sub form would be a good choice. would there be a way to make it so that the user can only use the scroll bar for it and not click anything inside the sub form?
 
Can you attach a version of your app; as is its pretty difficult to find out what's going on...
 

Users who are viewing this thread

Back
Top Bottom