Exit a half populated Form without saving record

Steve78

Registered User.
Local time
Today, 01:27
Joined
Feb 24, 2006
Messages
13
Hi could someone point me in the right direction for this one,

I have a series of linked tabbed Forms. One of the Forms is mostly populated by Combo boxes which all work fine. My problem occurs when you go to add a new record and populate the form with the combo boxes but decide for some reason not to save the record but exit the form using the Close form command button or by using the close button at the top of the Form. Access seems to Save the record anyway. I have placed an Undo Cmd on the form to clear all text boxes which works fine but it does not stop a user from closing or exiting a Form by another means and stop them saving that incomplete record.

I would be grateful for any thoughts on how to solve this problem.

Thanks in advance
 
you can also add the undo command on certian conditions. on exit add #DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70#

for example:

if isnull(me.textbox) then DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70


good luck
 
Thanks guys just what I needed glad to know your out there!
 

Users who are viewing this thread

Back
Top Bottom