Hello all,
I don't like the look of Combo boxes on forms, especially on Continuous forms made to look like a spreadsheet. I think the arrow is distracting, and since you cannot change its color frequently looks bad. My plan was to use two controls - a text box, and a combo box. I would have the combo box hidden and the text box visible. When the user clicked on the text box, I would make the combo box visible, and hide the text box. Then, when the user left the field, I'd hide the combo box and reveal the text box.
Here is the code I used:
The first procedure runs fine, and when I click on the text box it changes to a combo box. However, when the second procedure runs, I get error 2110, cannot move focus.
Any ideas why I get this error, or any ideas of a better way to accomplish this??
Thanks,
Eric
I don't like the look of Combo boxes on forms, especially on Continuous forms made to look like a spreadsheet. I think the arrow is distracting, and since you cannot change its color frequently looks bad. My plan was to use two controls - a text box, and a combo box. I would have the combo box hidden and the text box visible. When the user clicked on the text box, I would make the combo box visible, and hide the text box. Then, when the user left the field, I'd hide the combo box and reveal the text box.
Here is the code I used:
Code:
Private Sub cboPlayerID_LostFocus()
Me.txtPlayerName.Visible = True
Me.txtPlayerName.SetFocus
Me.cboPlayerID.Visible = False
End Sub
Private Sub txtPlayerName_GotFocus()
Me.cboPlayerID.Visible = True
Me.cboPlayerID.SetFocus
Me.txtPlayerName.Visible = False
End Sub
The first procedure runs fine, and when I click on the text box it changes to a combo box. However, when the second procedure runs, I get error 2110, cannot move focus.
Any ideas why I get this error, or any ideas of a better way to accomplish this??
Thanks,
Eric