|
原代码来自简(ACCFANS)
Public jl As Long
Private Sub Command142_Click() '禁止滚动
jl = Me.CurrentRecord '记录当前记录号
'Me.AllowEdits = True '窗体可编辑
'Me.AllowDeletions = True '窗体可删除
End Sub
Private Sub Command143_Click() '允许滚动
jl = 0
'Me.AllowEdits = False '窗体不可编辑
'Me.AllowDeletions = False '窗体不可删除
End Sub
Private Sub Form_Current()
If jl <> 0 And Me.CurrentRecord <> jl Then
DoCmd.GoToRecord acForm, Me.Form.name, acGoTo, jl '返回原记录号
Me.Command142.Enabled = False
Me.Command143.Enabled = True
Else
Me.Command142.Enabled = True
Me.Command143.Enabled = False
End If
End Sub |
|