form record modified. Prompt window before quit

Lifeseeker

Registered User.
Local time
Today, 02:08
Joined
Mar 18, 2011
Messages
273
Hi,

Users would like to careful when it comes to updating through forms.

Is there any way to have Access pop-up a prompt window to indicate that the record currently shown on the form has been modified?

And if user wants to exit out of the form, another pop-up window should appear asking users if they wanna quit before Access registers changes.

Is this possible at all?

comment/thoughts much appreciated.
 
If you're only concerned about changes to existing records you'd use something like this:
Code:
Private Sub Form_Dirty(Cancel As Integer)

If Not Me.NewRecord Then
 MsgBox "Record Has Been Modified!"
End If

End Sub

Private Sub Form_BeforeUpdate(Cancel As Integer)
 If Not Me.NewRecord Then
  
  resp = MsgBox("Do you wish to save the change(s) to this record?", vbYesNo)
 
  If resp = vbNo Then
   Me.Undo
  End If
 
 End If
End Sub
Linq ;0)>
 
If you're only concerned about changes to existing records you'd use something like this:
Code:
Private Sub Form_Dirty(Cancel As Integer)

If Not Me.NewRecord Then
 MsgBox "Record Has Been Modified!"
End If

End Sub

Private Sub Form_BeforeUpdate(Cancel As Integer)
 If Not Me.NewRecord Then
  
  resp = MsgBox("Do you wish to save the change(s) to this record?", vbYesNo)
 
  If resp = vbNo Then
   Me.Undo
  End If
 
 End If
End Sub
Linq ;0)>


Hi Ling, thank you and it worked.


The other thing is....how shall I put a save button on the form that basically says "saved" when the change has been confirmed?

right now it says "saved" even when the change has been undone.


thanks again
 

Users who are viewing this thread

Back
Top Bottom