Setting focus
-
- 5StarLounger
- Posts: 1148
- Joined: 08 Feb 2010, 21:27
Setting focus
When you set the focus to a control on a tab in a form, do you have to set the focus to the tab first?
-
- Administrator
- Posts: 78620
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Setting focus
No, setting focus to a control on a tab page will automatically activate that tab page.
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1148
- Joined: 08 Feb 2010, 21:27
Re: Setting focus
I should have told more of the story, i get an error message on a setfocus command that i cannot set the focus to that control.
What are the conditions that a setfocus cannot work. I have a msgbox a few coomands after that setfocus command so i am not in VBA at the time it bombs.
What are the conditions that a setfocus cannot work. I have a msgbox a few coomands after that setfocus command so i am not in VBA at the time it bombs.
-
- Administrator
- Posts: 78620
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Setting focus
Does the error message mention why you can't set focus to it?
Is the control on a subform? If so, you must first set focus to the subform.
Is the control hidden at the moment that you want to set focus to it? If so, you must first make the control visible.
Is the control on a subform? If so, you must first set focus to the subform.
Is the control hidden at the moment that you want to set focus to it? If so, you must first make the control visible.
Best wishes,
Hans
Hans