Go To?

Sharon Hague

Registered User.
Local time
Today, 21:56
Joined
Jul 10, 2003
Messages
138
Hi All

I have a subform where the properties are set to Continuous Forms.

In the subform part of my formI have a text box called overtime and I want to be able to enter a number into the text box and then on key down it move to the overtime box in the next record underneath as opposed to it jumping right to the next text box for that record.

Is this possible?

Please advise.
 
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo Form_KeyDown_Err
Select Case KeyCode
Case vbKeyDown
DoCmd.GoToRecord Record:=acNext
KeyCode = 0
Case vbKeyUp
DoCmd.GoToRecord Record:=acPrevious
KeyCode = 0
Case Else

End Select

Form_KeyDown_Exit:
Exit Sub

Form_KeyDown_Err:
Select Case Err.Number
Case adhcErrInvalidRow
KeyCode = 0
Case Else
MsgBox "Error: " & Err.Description & _
" (" & Err.Number & ")"
End Select
Resume Form_KeyDown_Exit
End Sub
 
Rich

Thanks for your reply.

I have entered your code into my forms properties in the "on key down" but it doesn't work.

When I view my form and use my down arrow it jumps to the next text box to the right like it did before instead of jumping down.

Any ideas?
 
You also have to set your Key Preview to Yes
 

Users who are viewing this thread

Back
Top Bottom