Hi,
On my form, I have a button that when clicked set a Text box visible and moves the focus to it. Here's the code:
Private Sub btnAddLocation_Click()
Me.txtGeoName.Visible = True
Me.txtGeoName.SetFocus
End Sub
I get this error:
Runtime error 2110, Access cannot move the focus to txtGeoName
I have tried to use the macro builder too, but similar error.. I have red many threads on this. I red something about the text box might not exist before any action is taken on it, or something like that. Nothing seems to do the trick.
What is it with Text boxes and SetFocus?
KingBroil
On my form, I have a button that when clicked set a Text box visible and moves the focus to it. Here's the code:
Private Sub btnAddLocation_Click()
Me.txtGeoName.Visible = True
Me.txtGeoName.SetFocus
End Sub
I get this error:
Runtime error 2110, Access cannot move the focus to txtGeoName
I have tried to use the macro builder too, but similar error.. I have red many threads on this. I red something about the text box might not exist before any action is taken on it, or something like that. Nothing seems to do the trick.
What is it with Text boxes and SetFocus?
KingBroil