Form Close

G

Guest

I have a form that travelers enter information for a trip. I have two
command buttons one will direct them to the next form and the other one will
close the form. Is there a way if they click close for without saving it
will clear the information they just typed in. I only have 6 possiable
fields they could type in. Full Name, Date Leave, Date Return, Orgin,
Destination, and Purpose.
Thanks
Chey
 
J

Jeff Boyce

Chey

One approach would be to add code to the form's Close event. If the form is
"dirty" (i.e., something's changed), you could prompt the user to <Save>
before closing.

Or if you want to save any changes, no matter what, you could, in code, save
the form's data in the OnClose event.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

Well I don't what to give them the option I just want it to close. I know
they would say yes and this would defite the purpose. So on Dirty what could
I do?
 
J

Jeff Boyce

In Access, if you leave a record, it's saved. Whether you navigate to a new
record, or close the form, it should be saved.

So you wouldn't need to check for Me.Dirty or anything else.

If you want to be absolutely certain it was saved, take a look at:
DoCmd.RunCommand acCmdSaveRecord

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

I don't want to save it though. In my query I have TA Number in assending
order. To make the next available TA I have Full Name Is null. If a
traveler decides to just close but there name is in there the the next time
they go in to do a travel they will have 2 TA Numbers. So if they choose the
Close no save I want it to clear out the information they just entered. I
hope that make sense.
Thanks for your time
Chey
 
J

Jeff Boyce

Check Access HELP on the
Undo
command.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

Hi

I know this is months old but do you still need help on this.

I have just gone through the same process myself.

Let me know.
 
G

Guest

I am not sure if he is still having an issue with this or not, but I am.

It would be helpful if every message string ended with a solution. I was
looking for something else earlier and after 8 messages from 3 or 4 people,
the user ended the message string by saying, "Never mind I figured it out."
All that does is get 15 other people to ask the same question.
 

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

Similar Threads

Calander 1
Email in access 4
Hidden close button on form? 4
How to prevent users to close access 6
Cancel form entry 3
Test form for changes on close 6
Date Order 18
Access Sub form opens before the main form in MS Access 0

Top