|
谢谢各位的回复和指教
http://www.office-cn.net/forum.php?mod=viewthread&tid=35677
有感于以上文章用 变更记录类型+返回原记录解决了问题,不过再请教下各位:如果数据量大时 DoCmd.GoToRecord acForm, Me.Form.Name, acGoTo, f 的跳转速度如何?
Dim f As String
Dim Dirt As Boolean
Private Sub 修改_Click()
f = Me.CurrentRecord '记录当前记录号
Me.RecordsetType = 0
DoCmd.GoToRecord acForm, Me.Form.Name, acGoTo, f '返回原记录号
End Sub
Private Sub 保存_Click()
If Dirt Then
Dirt = False
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.RecordsetType = 2
DoCmd.GoToRecord acForm, Me.Form.Name, acGoTo, f '返回原记录号
End If
End Sub
Private Sub Form_Dirty(Cancel As Integer)
Dirt = True
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Dirt Then Cancel = True
End Sub |
|