Depends on what Undo you are expecting it to do.
Once a record is saved, it is saved so you cannot discard changes after that.
But you might be able to code for it - investigate using the begintrans/committrans functions. Alternatively bind your form to a temporary table(s) and have a button to append to the appropriate tables once done. Another method is to use disconnected ADO recordsets - but be aware forms are coded to work with DAO so the default sort/filter won't work and will generate an error, so either disable or write your own routines.
Don't know about form layout if you have code modifying that. My approach is to have a function that sets out the form depending on conditions - say the form back colour changes and some controls are hidden/disabled/whatever.
It is then called in the form open or current event (depending on requirement) as well as whenever the user makes a choice which impacts the look of the form (such as clicking a button, making a selection from combo or listbox)
This would probably solve your problem in your other thread as the function would set a 'default' view when the form is opened.
I was wanting it to do exactly the same thing the upper left arrow does (quick toolbar) in a form. In other words, it's right there for the user if I lock down what Access displays as far as tool bars go.Depends on what Undo you are expecting it to do.
Once a record is saved, it is saved so you cannot discard changes after that.
...
Don't know about form layout if you have code modifying that. My approach is to have a function that sets out the form depending on conditions - say the form back colour changes and some controls are hidden/disabled/whatever.
It is then called in the form open or current event (depending on requirement) as well as whenever the user makes a choice which impacts the look of the form (such as clicking a button, making a selection from combo or listbox)
This would probably solve your problem in your other thread as the function would set a 'default' view when the form is opened.
I've been using sub to do all my conditions when changing a form, the subs often go three levels deep, one for the form procedure, one for an generic forms or report module, and one for super generic that covers forms and reports (like changing those codes for color in Access to something VBA can use).
Last edited by twgonder; 08-06-2022 at 03:33 PM.