我在这里遇到问题(非常简单但我无法解决)。我在表单上有保存按钮,使用vba代码保存记录(Do.Cmd.Save),但遗憾的是它不是功能。我把这些代码放在下面。感谢您的亲切帮助!
Private Sub Command110_Click()
'Provide the user with the option to save/undo
'changes made to the record in the form
If MsgBox("Changes have been made to this record." _
& vbCrLf & vbCrLf & "Do you want to save these changes?" _
, vbYesNo, "Changes Made") = vbYes Then
DoCmd.Save
Else
DoCmd.RunCommand acCmdUndo
End If
End Sub
答案 0 :(得分:1)
DoCmd.Save
保存对Access对象的更改(例如查询或表单定义)。
要保存记录,请使用
DoCmd.RunCommand acCmdSaveRecord