Close command taking long time

  • Thread starter Thread starter Matuag
  • Start date Start date
M

Matuag

My form has a Exit button which takes excessively long time to close
the form. I have tried both macro and VBA code such as following
without any success.

Private Sub Exit_Click()
On Error GoTo Err_Exit_Click

DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close

Exit_Exit_Click:
Exit Sub

Err_Exit_Click:
MsgBox Err.Description
Resume Exit_Exit_Click

End Sub

What could be the problem?
 
Hi again,

I thought of some more questions.
Is the DB on a network on another computer?
Is this a split DB? If so, is the back end on a server or a regular PC?

To test the speed in which each command is running you can add a beep
command after each command and check how long it takes to beep after the
button click and between beeps.

This code will make it beep after each of the other commands:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.Beep
DoCmd.Close
DoCmd.Beep

Hunter57
http://easymsaccess.blogspot.com (Simple Access Tips)
http://www.ChurchManageSoftware.com
 
no bitch

they don't need compact and repair; they need Access Data Projects
 
Back
Top