Preventing close buttons from saving records in MS Access

后端 未结 6 1209
小蘑菇
小蘑菇 2021-02-10 11:42

In a Microsoft Access form, whenever the current record changes, any changes in bound controls are silently saved to the database tables. This is fine, but I don\'t want it to h

6条回答
  •  眼角桃花
    2021-02-10 12:23

    ** you can use exit button with this code**

    Private Sub Button_Click()
    If Me.Dirty = True Then
       If MsgBox(" Save Change ", vbYesNo) = vbYes Then
          Me.Dirty = False
       Else
          Me.Undo
       End If
    End If
    DoCmd.Close acForm, "FormName"
    End Sub
    

提交回复
热议问题