How do i create a button that saves the current record and moves to a new one? I want to do it in such a way that microsoft access acknowledges the button.
Below is the following codes in my form:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then
'Ensure that users do not accidentally save records
If MsgBox("Do you want to save the updated records?", vbOKCancel, "Save?") = vbCancel Then
Me.Undo
End If
End If
End Sub
Private Sub btnUndoIndividualBorrower_Click()
'clicking on this will undo changes
Me.Undo
End Sub
Private Sub Form_Current()
' Disable undo changes button
Me!btnUndoIndividualBorrower.Enabled = False
End Sub
Private Sub Form_Dirty(Cancel As Integer)
'enable changes button
Me!btnUndoIndividualBorrower.Enabled = True
End Sub
I tried to create save and go to new record using macros and the wizard but im not sure if they even work because everytime i press the button my beforeupdate event appears. How can modify the code such that when i press the button, it savees the record and goes to a new one without displaying my "Do you want to save updates?" message.
Below is the following codes in my form:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then
'Ensure that users do not accidentally save records
If MsgBox("Do you want to save the updated records?", vbOKCancel, "Save?") = vbCancel Then
Me.Undo
End If
End If
End Sub
Private Sub btnUndoIndividualBorrower_Click()
'clicking on this will undo changes
Me.Undo
End Sub
Private Sub Form_Current()
' Disable undo changes button
Me!btnUndoIndividualBorrower.Enabled = False
End Sub
Private Sub Form_Dirty(Cancel As Integer)
'enable changes button
Me!btnUndoIndividualBorrower.Enabled = True
End Sub
I tried to create save and go to new record using macros and the wizard but im not sure if they even work because everytime i press the button my beforeupdate event appears. How can modify the code such that when i press the button, it savees the record and goes to a new one without displaying my "Do you want to save updates?" message.