undo changes to a from issue

Ashleyjp1985

Registered User.
Local time
Today, 16:02
Joined
Jul 6, 2011
Messages
22
I have a form with an undo button which works fine...sometimes.

the issue is if the user hasn't clicked out of the text box they have updated before clicking the undo changes button only the changes they have made to that text box are un-done.

my question is when the user clicks the undo chnages button how do i code it so the changes to the whole form are undone even if they haven't clicked out of the last text box they updated.
 
Can you show us the code that you are using in the button's On Click event.
If you are using:
Me.Undo
try repeating the line:
Me.Undo
Me.Undo
 
I wanted to say that once a user clicks on a button, they have updated the text box from which they are coming. Access will not allow the focus to leave a box unless the rules for that box are satisfied and the update was sucessful. Therefore, if you can click on a button, you have updated the last place the cursor was located.
 
I wanted to say that once a user clicks on a button, they have updated the text box from which they are coming. Access will not allow the focus to leave a box unless the rules for that box are satisfied and the update was sucessful. Therefore, if you can click on a button, you have updated the last place the cursor was located.
The text box will have updated but the record may still be dirty. While it is dirty, it can still be "Undone".
 
Hi,

thanks for the responses, code below:

If Me.Dirty = False Then
MsgBox "No changes have been made or have already been undone/saved.", vbOKOnly, "Information"
Else

DoCmd.RunCommand acCmdUndo

MsgBox "Changes have been discarded.", vbOKOnly, "Information"
Me.Dirty = False
End If

this will undo all the changes the user has made to the record, but only if they have moved from the last text box they changed. if they havent moved then when they click the button it will only undo the changes made to that box and then crashes because of the last Me.Dirty = False.
 

Users who are viewing this thread

Back
Top Bottom