A
aemAndy
I have a form that uses combo boxes to allow the user to select a customer.
Sometimes they want to have the combo box show the information by ID#,
sometimes by name.
I created radio button to select the method. If they select the radio
button for ID, it enables the ID# combo box, disables the Name combo box and
makes the Name box invisible.
If they press the button for Name, it switches what is visible and enabled.
My problem - I figured it would be nice if upon entering the form, you were
directly in the combo box field (default set at ID#), or, upon selecting one
or the other button, it takes you to the field right away.
SetFocus, SelectObject work to get me there, but then you can't go back and
select the other radio button option. I lets me press regular buttons, but
not the radio button selectors.
So.... any insight you can lend would be great....
-------------------------------------
Private Sub Form_Load()
Me.Combo4.Visible = False
Me.Combo4.Enabled = False
Me.Combo7.Visible = True
Me.Combo7.Enabled = True
Me.Combo7.SetFocus
End Sub
--------------------------------------
Private Sub Option13_GotFocus()
Me.Combo4.Visible = True
Me.Combo4.Enabled = True
Me.Combo7.Visible = False
Me.Combo7.Enabled = False
Me.Combo4.SetFocus
End Sub
---------------------------------------
Private Sub Option15_GotFocus()
Me.Combo4.Visible = False
Me.Combo4.Enabled = False
Me.Combo7.Visible = True
Me.Combo7.Enabled = True
Me.Combo7.SetFocus
End Sub
Sometimes they want to have the combo box show the information by ID#,
sometimes by name.
I created radio button to select the method. If they select the radio
button for ID, it enables the ID# combo box, disables the Name combo box and
makes the Name box invisible.
If they press the button for Name, it switches what is visible and enabled.
My problem - I figured it would be nice if upon entering the form, you were
directly in the combo box field (default set at ID#), or, upon selecting one
or the other button, it takes you to the field right away.
SetFocus, SelectObject work to get me there, but then you can't go back and
select the other radio button option. I lets me press regular buttons, but
not the radio button selectors.
So.... any insight you can lend would be great....
-------------------------------------
Private Sub Form_Load()
Me.Combo4.Visible = False
Me.Combo4.Enabled = False
Me.Combo7.Visible = True
Me.Combo7.Enabled = True
Me.Combo7.SetFocus
End Sub
--------------------------------------
Private Sub Option13_GotFocus()
Me.Combo4.Visible = True
Me.Combo4.Enabled = True
Me.Combo7.Visible = False
Me.Combo7.Enabled = False
Me.Combo4.SetFocus
End Sub
---------------------------------------
Private Sub Option15_GotFocus()
Me.Combo4.Visible = False
Me.Combo4.Enabled = False
Me.Combo7.Visible = True
Me.Combo7.Enabled = True
Me.Combo7.SetFocus
End Sub