I am using this code to set the focus on the end of the text box in a form but I can only do so if I set the focus to that text box which is at the middle of my form. I have setup tab control and I want the focus to be at the first text box.
My code is:
Me.txtBox.Locked = True
Me.txtBox.SetFocus
Me.txtBox.SelStart = Len(Me.txtBox.Text)
I tried add this after the code above to set the focus to first text box again.
pfPositionCursor Me.txtBox1
But I get sub or function undefined on pfPositionCursor
Is there a way to do something like this?
pfPositionCursor
then of course you can't call it. Also, "placing the cursor" in a TextBox means that the next Input from the keyboard will be at that position, and as that is in that TextBox , the TextBox has the focus. For controls, "having the focus" and "the next keystroke affects this control" are equivalent. – Wolfgang Kais