[AccessD] Closing form problem

Dan Waters df.waters at outlook.com
Wed Jan 6 14:00:01 CST 2016


Comment out the Exit and LostFocus events.

In the AfterUpdate event try just this:

        DoCmd.Close acForm, Me.Name


-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Kaup, Chester
Sent: Wednesday, January 06, 2016 12:34 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Closing form problem

I tried moving the event procedure to the lost focus event and then closing
the form but still not success. The save record and dirty commends run fine.
Code as below. I am still at a loss as to wny I cannot close the form in
code but the close button works fine.

Private Sub Not_defined_LostFocus()
    Stop
    DoCmd.RunCommand acCmdSaveRecord
    Me.Dirty = False
End Sub




More information about the AccessD mailing list