Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Slow Compact on Close

Status
Not open for further replies.

Costefran

Technical User
Jan 2, 2008
197
GB
Can anyone help with the following

I have ticked the compact on close in the tools - options as previously advised on another thread (because my database grows considerably when opened and closed) and this works great
Unfortunately the compact on close now takes quite a while (which is okay for me but might drive my eventual users mad)

Is there anyway to speed this up through selecting what is / is not compacted etc

This is probably a stupid question and gives you some idea of my lack of knowledge

Perhaps there are some general rules around compacting etc or preventing the DB from growing so I don't need to compact

I have read up a bit on compacting and understand that compacting is done to remove unsused space after records have been deleted but my database grows if its simply opened and closed again so perhaps there is something else I should be looking at

Many thanks in advance
 
Which code is launched when you open the DB ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV

Not sure this answers your question but to explain I have created a log - in form that automatically opens on startup (the code is below). Once logged in the form remains open but invixible while the user is logged in.
Also, I have quite a few tables in my DB, will this affect compacting and although this may be a side issue, I have noticed two other objects when viewing project explorer that are labelled

Form...TMPCLP449331 and
Form...TMPCLP582191

When I view the related objects they are forms that I no longer need but cannot see them in my form list to delete


Anyway here is the code regarding the log - in form


Private Sub Enter_Button_Click()
On Error GoTo Err_Enter_Button_Click
Dim stDocName As String
stDocName = "2nd ML Authorisation Required"
DoCmd.RunMacro stDocName
Exit_Enter_Button_Click:
Exit Sub
Err_Enter_Button_Click:
MsgBox Err.Description
Resume Exit_Enter_Button_Click
End Sub

Private Sub Login_Enter_Button_Click()
On Error GoTo Err_Login_Enter_Button_Click
Dim stDocName As String
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
stDocName = "Log In Form Set Budget Involvement"
DoCmd.RunMacro stDocName
stDocName = "Open Switchboard"
DoCmd.RunMacro stDocName
Exit_Login_Enter_Button_Click:
Exit Sub
Err_Login_Enter_Button_Click:
MsgBox Err.Description
Resume Exit_Login_Enter_Button_Click
End Sub

Private Sub OPEN_SWITCHBOARD_Click()
On Error GoTo Err_OPEN_SWITCHBOARD_Click
Dim stDocName As String
stDocName = "Open Switchboard"
DoCmd.RunMacro stDocName
Exit_OPEN_SWITCHBOARD_Click:
Exit Sub
Err_OPEN_SWITCHBOARD_Click:
MsgBox Err.Description
Resume Exit_OPEN_SWITCHBOARD_Click
End Sub

Private Sub Name_AfterUpdate()
stDocName = "Enable Password"
DoCmd.RunMacro stDocName
[Password].SetFocus
End Sub

Private Sub Password_AfterUpdate()
[Log in Form Query for Other Subform 4 subform].Form.Requery
stDocName = "Log In Form Macro"
DoCmd.RunMacro stDocName

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top