"Undo changes" before saving record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a parent form (frmMaster) which contains key clientID and ClientName,
a continous subform (frmClientAppt) which contains Key ApptID and foreign
key clientID and they are related in a 1:many. The subform displays summary
info for all of a client's appointments in a continous form. When one of the
appointments is selected a separate form opens "frmEdit" displaying the
details of that appointment, allowing the user to edit info from this appt.
There is a button "save and close" which records changes and refreshes the
parent/subform and this works fine. I would like to have a button on
"frmEdit" ("CancelChanges and Close")that cancels any changes, closes
"frmEdit" leaving everything as it was before the user opened the "frmEdit"
form. Any advice would be appreciated.
 
Using the Esc (Escape) key twice (first time for field, the second the
record) will undo the record. Using:

Me.Undo

in code, does the same. What neither does is avoid using an autonumber,
which will be burned in any case. The only way to avoid using up a number is
to NOT use an autonumber and instead generate your own. Look into using the
DMax function for that. That presents some other problems, chiefly involving
multiple users, and still won't resolve any holes occuring because of of
deletion or records. In fact, keys are used soley for data integrity. Any
other use is incidental.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top