Code to change Access Defaults

  • Thread starter Thread starter Brigitte P
  • Start date Start date
B

Brigitte P

Is there a way to change the defaults of Access 2002 Windows 2000 in code,
best in the form that opens the database (Switchboard or other form)?
I would like to put in code what I can do with Tools - Options - View -
Windows in Taskbar off.
This seems to be Access dependent and not database dependent. When I
instruct the users to use the above procedure to prevent that all Forms,
Queries, Reports etc. stay open in the taskbar, Access resets when the
computer is restarted because of Windows Profile issues (over which I have
no control). The easiest way to do this, I think, have some code run when
the database opens that resets the above Access default. Maybe there is a
better way, but I can't see it. If any kind person out there would help me,
please give pretty much all code lines because I'm not a programmer, or at
least send me in the direction where I can find this.
Any help is greatly appreciated.
Brigitte P.
 
Did go to site and found some help. But here my
programming ignorance comes in. I used the following code
in a global module which I then will try to run with a
macro that will be executed at startup. Hope this will
work.

Option Compare Database
Function SetStartupOptions()

Dim varSetting As Variant
varSetting = Application.GetOption("Default Database
Directory")
Application.SetOption "Default Database
Directory", "C:/Local Databases/Trial.mdb"
Application.SetOption "ShowWindowsInTaskbar", True

End Function

However, I get an error message that Access cannot change
the working directory and it stops. We run all front ends
from the local machine with the back ends on the server. I
seem to have access to the c:/Local Databases folder and I
didn't make a typing error (copied path from a shortcut
that I created temporarily). The path is also less than
the allowed 260 characters. Any additional help is greatly
appreciated.
Brigitte P.
 
Thank you; it's resolved. I did the code too complicated,
but went to the VBA help. The following code, put in Load
Event in the Switchboard does the trick.

Private Sub Form_Load()
Application.SetOption "ShowWindowsInTaskbar", False
DoCmd.Maximize
End Sub

Leading me to the appropriate Microsoft article got me
where I needed to be. Thanks again.
Brigitte P.
 
Back
Top