Click to See Complete Forum and Search --> : Hitting enter to move to the next input box


patrick413
June 15th, 2001, 08:18 AM
Hi I have a Control Array of 4 text input boxes. I want to have the user hit enter on each one and as a result have the focus move to the next... then finally on "submit data".

How can I do this?

Any help appreciated!
Thanks.
Pat

dfwade
June 15th, 2001, 08:38 AM
I think this is what you are looking for, in the keypress event trap that the control arrays index is not the last item else move to the next item


private Sub Text1_KeyPress(Index as Integer, KeyAscii as Integer)
If Index = Text1.UBound then
'Do Your Submit
Exit Sub
End If

Select Case KeyAscii
Case 13
Text1(Index + 1).SetFocus
End Select

End Sub