chrisgoode
New Member
- Joined
- Jan 15, 2015
- Messages
- 1
I have a simple excel spread sheet that I am using VBA to run a form. What I want to do is when the enter key is hit on the NextRecord button (which puts the entries into my spreadsheet) I want the focus to turn back to TextBox4. Instead the cursor is moving to the next command box. I know the reason for this is because I have code where I am substituting the tab key for the enter key but I can't figure out another way. This is going to be installed on a handheld with windows mobile so there is no capability for a mouse click. This is my first go at any programming so I greatly appreciate any help. Code snippets that I am using:
- Private Sub TextBox4_KeyDown(ByVal KeyCode As _MSForms.ReturnInteger, ByVal Shift As Integer)
- If KeyCode = 13 Then KeyCode = 9
- End Sub
- Private Sub NextRecord_Enter() Dim i As Integer
- TextBox4.Text = ""
- TextBox4.SetFocus
- End Sub
Last edited: