Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checkbox-property

Status
Not open for further replies.

JohnLong

Programmer
Apr 21, 2004
15
NL
I want to set the focus to a checkbox. But vba don't let me doing this. Therefore I want to add this property to the checkbox-property and set the focus to the checkbox. How can I manage this?

 
If my memory still serves me you can put a label just before the checkbox in the tab order and when the label receives the focus it gets bumped on to the Checkbox
 
I have tried that, but it doesn't work. When I try this, vba gives the message It can't set the focus on the object because this type doesn't accept "setfocus
 
Sorry ignore my last post I was thinking of something else!

Aer you using the VBA Controls Checkbox or the checkbox from Excel Forms?
 
I have tried it, but I'm sorry, it doesn't work. I got the message "The argument is not optional". Probably because you mentioned: thisdocument, in my application the checkbox is on a form.
 
Something like this ?
UserForm1.CheckBox1.SetFocus

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Hi,

Yes I tried this one also. Now I find out it doesn't work at all.
I am trying to get the focus to the checkbox by setting its tabindex. But then I get other problems. When I want to set the tabindex of the checkbox, there is no problem, because there are only three of them. But when I want to return to the commandbutton, I get problems because I don't know which button the last button was, and when I do know it, I have to write a lot of code!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top