Hello,
I have a form with 3 textboxes (itemCode , txt1, txt2) and 1 button (simplifying for this example). The textbox itemCode has an input mask.
User must: 1) manually enter itemCode , 2) click the button and vba script fills txt1 and sets focus to txt2.
Also, all three textboxes are unbound.
All works fine if after entering itemCode user hits Tab or Enter to move to next textbox, but if "text cursor" remains in the itemCode (at the end of entered value) I get an error
and on second try
It must be something to do with textbox being "dirty", but can't find solution.
Edits: Added VBA code and changed textbox name, to be less confusing
I have a form with 3 textboxes (itemCode , txt1, txt2) and 1 button (simplifying for this example). The textbox itemCode has an input mask.
User must: 1) manually enter itemCode , 2) click the button and vba script fills txt1 and sets focus to txt2.
Code:
Private Sub button1_Click()
Me.txt1 = "A10"
Me.txt2.SetFocus
End Sub
Also, all three textboxes are unbound.
All works fine if after entering itemCode user hits Tab or Enter to move to next textbox, but if "text cursor" remains in the itemCode (at the end of entered value) I get an error
Run-time error 2110: Access can't move the focus to the control txt2
and on second try
Run-time error 7: Out of memory.
It must be something to do with textbox being "dirty", but can't find solution.
Edits: Added VBA code and changed textbox name, to be less confusing
Last edited: