form exit query

jalldridge

Registered User.
Local time
Today, 05:44
Joined
May 3, 2005
Messages
60
Obviously doing something stupid here :-)

I use a form for data entry. When I hit the next arrow in the navigation button section (the default navigation buttons supplied by access), by data is saved into the relevant table.

When the I press the X on the form my data is also saved. However I'm not given the opportunity to say if I want to quit the form or save the data.

What do I need to set to get this functionality?

Thanks
 
I would remove the X (form properties,format,close button = no
The have and add record button Cancel record button
( if you click on the x after only partially filling fields a partial record will be saved)
 
If you want to validate every entry then you'll have to code the BeforeUpdate event of the form
 
I believe you are looking for the BeforeUpdate event of the form where you can do a Me.Undo if you want.
 
I could do the me.undo in the before_update but I need to know somehow that the user had tried to close the form via the X (dont want to cancel an actual record add)

The close event is only called *after* the before_update event so I have no way of setting a flag that could be used in the before update event.
 
The BeforeUpdate event is the best and easiest way, however you can use a CanClose boolean method.
There have been posts here with the codes, search for CanClose
 

Users who are viewing this thread

Back
Top Bottom