Stop table being updated on close of form

dynamictiger

Registered User.
Local time
Today, 14:23
Joined
Feb 3, 2002
Messages
270
I have a form for entry of name and address details on the form I have a go back button that closes the form.

I have a function to iterate through the controls and if they are empty returns blnCancel.

Currently my code on the go back button is

Call CheckEmpty(blnCancel)

If blnCancel Then

DoCmd.Close acForm, "frmClientDetail", acSaveNo

Else

DoCmd.Close acForm, "frmClientDetail"

End If

I thought this would stop an incomplete record from saving. It doesn't and I don't know why.
 
Not totally sure on this but...
Me.Undo
Then close your form
 
That was what I was missing. I tried to run acCmdUndo but that gave me an error.
 
Just a thought...

What if the user was not aware that they had an imcomplete record when they were closing the form?

I would test if the current record is dirty and if true, alert the user to either undo or complete (and save) the record before they can close the form.

HTH
 

Users who are viewing this thread

Back
Top Bottom