In my startup routine, I have the following code:
s = CLng(FileLen(filespec) / 1000000)
If s > 5 Then
'FIRST, BACKUP THE FRONT END
If BackupFrontEnd = False Then
Exit Function
End If
'Now set the autocompact at close
Application.SetOption ("Auto Compact"), 1 'compact app
Else
Application.SetOption ("Auto Compact"), 0 'no don't compact app
End If
s is the size of the front end in MB. BackupFrontEnd is a function that
first backups the front end. It is working fine.
The idea is if the front end gets beyond a certain size (set to 5 MB here
for testing), the compact on close option is to be set so that when the
user closes the front end it will compact. I don't want to compact after
every close.
Here's the problem. It works fine if a user is an administrator. I can
verify that compacting occurs upon closing the front end by looking at the
status bar. If the user is part of the Users group, however, then
compacting does not occur. I have stepped through the code when logged on
as a regular user. The code definately sets the Auto Compact Option to 1. I
then double checked by typing in the Immediate Pane:
?Application.GetOption ("Auto Compact")
-1 came back as the answer, which I'm pretty sure stands for True.
Still, when closing the front end when logged on as a User and not an
Administrator, compacting does not occur because I don't see any message in
the status bar saying that compacting is or has occurred.
The code works without a problem when logged on as an administrator.
I am totally stumped and have no idea what the problem could be.
Thanks for any help.
--
Message posted via http://www.accessmonster.com