Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / October 2007

Tip: Looking for answers? Try searching our database.

Compile and Repair

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Qdxss2b - 23 Oct 2007 21:29 GMT
I have set up a database that is beening used by several other users.

What I would like to do is to write a macro or VBA so that when the program
is being shut down, it will do a compile and repair automaticaly.

Is this possible?  

The program is set up so that the basic toolbars are not available for the
users, so anyone login as a user would not be able to access the button on
the toolbar.

Can anybody help?
biganthony - 24 Oct 2007 02:24 GMT
Hi

Someone gave me this function:

Public Function AutoCompactApplication()

   Dim s
   Dim strProjectPath As String, strProjectName As String
   
   strProjectPath = Application.CurrentProject.Path
   strProjectName = Application.CurrentProject.Name
   filespec = strProjectPath & "\" & strProjectName
     
   s = CLng(FileLen(filespec) / 1000000)  'convert size
     
   If s > 20 Then   'edit the 20 (Mb's) to the max size you want to allow
your app to grow.
         
       Application.SetOption ("Auto Compact"), 1   'compact app
   
   Else
       
       Application.SetOption ("Auto Compact"), 0   'no don't compact app
   
   End If
   
End Function

Call the function when your DB closes down.

>I have set up a database that is beening used by several other users.
>
[quoted text clipped - 8 lines]
>
>Can anybody help?
Qdxss2b - 24 Oct 2007 20:23 GMT
Thank you.  I will give that a try.

>Hi
>
[quoted text clipped - 31 lines]
>>
>>Can anybody help?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.