seeking_help
06-17-2008, 01:49 PM
Hi all,
I am having trouble when I set focus to a text box that is related to an option box. I am using VBA, here is the situation.
I have an option group with 3 radio buttons. One of the buttons has a text box that gets enabled when the radio button gets focus. I want to set focus to the text box right after that to skip the step of a manual click into the text box before you can type. When I try to set the focus it will indeed move the cursor to the textbox but it will not click the radio button. So i am left with the last selected radio button which is incorrect and will give me bogus info(example- opbButton1 is default(has the green dot) when I click opbButton3 the text box associated with it will then be enabled but opbButton1 still has the green dot).
Sample code for opbButton3_GotFocus
'---------------------------------------------
Private Sub opbAnotherProject_GotFocus()
' enables tbdiffprojnum, clears the combo0 box and disables copy btn
tbDiffProjJobNum.Enabled = True
Form_frmPickFixture.Combo0.Value = ""
Form_frmPickFixture.cmdCopyFrom.Enabled = False
End Sub
'------------------------------------------------
I have tried adding tbDiffProjJobNum.SetFocus or Me.<same code>
but that is what gives me the problem I have with the radio button not being clicked.
There is no _Click() event available only MouseUp,Down, or Move.
What I thought was going to be a simple single line of code is giving me fits.
Anyone have any ideas on why this is happening or a way to fix it?
Thanks for the help!
Josh
I am having trouble when I set focus to a text box that is related to an option box. I am using VBA, here is the situation.
I have an option group with 3 radio buttons. One of the buttons has a text box that gets enabled when the radio button gets focus. I want to set focus to the text box right after that to skip the step of a manual click into the text box before you can type. When I try to set the focus it will indeed move the cursor to the textbox but it will not click the radio button. So i am left with the last selected radio button which is incorrect and will give me bogus info(example- opbButton1 is default(has the green dot) when I click opbButton3 the text box associated with it will then be enabled but opbButton1 still has the green dot).
Sample code for opbButton3_GotFocus
'---------------------------------------------
Private Sub opbAnotherProject_GotFocus()
' enables tbdiffprojnum, clears the combo0 box and disables copy btn
tbDiffProjJobNum.Enabled = True
Form_frmPickFixture.Combo0.Value = ""
Form_frmPickFixture.cmdCopyFrom.Enabled = False
End Sub
'------------------------------------------------
I have tried adding tbDiffProjJobNum.SetFocus or Me.<same code>
but that is what gives me the problem I have with the radio button not being clicked.
There is no _Click() event available only MouseUp,Down, or Move.
What I thought was going to be a simple single line of code is giving me fits.
Anyone have any ideas on why this is happening or a way to fix it?
Thanks for the help!
Josh