Undo button clears all the fields

amanp786

New member
Local time
Today, 09:03
Joined
Dec 2, 2016
Messages
4
Hello,

I would like to say I have done ALOT of research online & also youtube but I have yet to find the answer I need.

I have created Undo Button in my form by using the Command Button Wizard. The button, clears all the textbox fields in the form instead of working like a normal undo button we are custom to. I want the button to function as a undo not clear.

I have used Me.Undo and also the DoCmd.RunCommand acCmdUndo method and got the same results. Is there a VBA I can use that will undo my mistake instead of clearing all of my form?

Thank you!
 
Last edited:
Me.Undo works for me when I have a bound form and am editing an existing record.

1. Is your form bound to a table/query?

2. Are you working with an existing record or a new record when you click the button?
 
Plog,

1. I believe my form is bound by table because the data in the form is coming from the table I have. When creating the form, I selected my table as Record Source. So yes, my form is bounded by table

2. When I click the button, I am working with a new record.
 
Can you upload your database? or make it available somehow?
 
Hello,

As you can see, when you are in Form View of Lawyer Form and type something in and click undo at the bottom, it clears the box if you are typing on a existing record. However, when you create a New Record and type something in than click undo, it will clear the entire page. Please help.

PS why is this file saving as .php when I try to save it on my computer
 

Attachments

I understand what you are saying, but that also sounds like how it should work. To get around this, I think you need to put some code on the OnChange event of the first name that reloads the form to the same record--that way it will be treated as an existing record and your undo will work.
 
@amanp

if you start typing in a new record, then click undo, you are clearing the new record.

I presume access then deals with this by closing the edit, and reverting to the previous record.

If you enter data in 2 fields, and then undo does it undo the whole record, or just the one field?

If the behaviour happens when it unpopulates the only field that was entered - ie cancels the entire edit, then this must be standard access behaviour, and there isn't much you can do I imagine, The user just needs to click whatever is necessary to restart a new record.
 

Users who are viewing this thread

Back
Top Bottom