Cancel button

G

Guest

Hello,

I am looking to put a cancel button on my data entry form. When the user's
already typed something, I can Undo and Close, but if they decide to cancel
before they even enter data, I get an error message that Undo cannot be
performed.

I guess I need to check if the form has changed already or not and then
either do a straight close, or an Undo and Close.

Can I get some help with that please?

Thank you.
 
G

Guest

Niniel said:
Hello,

I am looking to put a cancel button on my data entry form. When the user's
already typed something, I can Undo and Close, but if they decide to cancel
before they even enter data, I get an error message that Undo cannot be
performed.

I guess I need to check if the form has changed already or not and then
either do a straight close, or an Undo and Close.

Can I get some help with that please?

Thank you.

Just check if the dirty flag is set to true for the form

if Me.Dirty = True then
Me.Undo
end if

Me.Close
 
G

Guest

Hi, I'm beginner in access.
I've got the same problem which is having message about Undo cannot be
performed and if I do not use the undo button,when I close the form without
finishing their form, it's been saved also.
Where did I need to put this:

if Me.Dirty = True then
Me.Undo
end if

Me.Close

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top