If this is a form with no subform, you can use code in the Cancel button's click
event to UNDO the changes and then close the form
Sample (UNTESTED) code
Me.Undo '<-- undoes all unsaved changes to the form
DoCmd.Close acForm, Me.Name
> good day all,
>
[quoted text clipped - 12 lines]
>
> Brook
Brook - 15 Oct 2005 14:58 GMT
good day John,
I set it up like you suggested, however when I click the close button I
get a runtime error 2498.
an Expression you entered is the wrong data type for one of the arguements?
Any ideas?
Thanks for the post.... and suggestions..
Brook
> If this is a form with no subform, you can use code in the Cancel button's click
> event to UNDO the changes and then close the form
[quoted text clipped - 19 lines]
> >
> > Brook
John Spencer - 17 Oct 2005 03:47 GMT
Strange, it works for me. I just retested it.
What version of Access are you using?
Did you enter the code exactly as posted? No substitutions.
> good day John,
>
[quoted text clipped - 32 lines]
> > >
> > > Brook
Brook - 17 Oct 2005 06:49 GMT
Good Day John,
I had an extra " . " in one of the pieces of code.
It works fine now.. thanks for the help!
Brook
> Strange, it works for me. I just retested it.
>
[quoted text clipped - 38 lines]
> > > >
> > > > Brook