|
'使用键盘上下方向键来移动连续窗体记录
'实现和数据表同样的功能
Private Sub 客户ID_KeyDown(KeyCode As Integer, Shift As Integer)
Call myMoveRecord(KeyCode, Shift, Me.客户ID)
End Sub
Public Function myMoveRecord(KeyCode As Integer, Shift As Integer, ctl As Control)
On Error GoTo err
Debug.Print KeyCode
Select Case KeyCode
Case 38
DoCmd.GoToRecord , , acPrevious
Case 40
DoCmd.GoToRecord , , acNext
End Select
ctl.SetFocus
Exit Function
err:
If err.Number <> 2105 Then
MsgBox err.Number & err.Description
End If
End Function
|
|