Stop user from seeing category down the side

resolva

Registered User.
Local time
Today, 08:02
Joined
Apr 7, 2009
Messages
35
Hey all,

I havent finished developing a database and have a switchboard setup as well as navigation macros.

1) How do i make it so the switchboard loads up when access loads?
2) How do I prevent the user seeing the forms/queries/reports down the side and removing them?

Kind regards,

Aaron Luckie
 
1) How do i make it so the switchboard loads up when access loads?
If using Access 2007,

1. go to the Big Round Office Button

2. Select Access Options

3. Select Current Database

4. Select the Switchboard form as the Startup Form from the drop down under startup form.
2) How do I prevent the user seeing the forms/queries/reports down the side and removing them?
1. In the same Current Database spot in Access Options, deselect the Display Navigation Pane checkbox

2. Uncheck USE ACCESS SPECIAL KEYS checkbox (so they can't use F11 to bring up the Nav Pane)
Kind regards,
 
If you'd rather not use the switchboard, you can do something like this:

1) Create an autoexec macro that opens your desired main form
2) For your main form, create an On Load event with the following code (but don't execute it yet)
Code:
Private Sub Form_Load()
DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowHide
Dim I As Integer
For I = 1 To CommandBars.Count
CommandBars(I).Enabled = False
Next I
End Sub
3) Because this will stick the hidden windows for all of Access, make sure to create a button that will enable everything upon clicking using the following code:
Code:
Private Sub CloseDatabase_Click()
'CommandBars("Property Sheet").Enabled = True
Dim I As Integer
For I = 1 To CommandBars.Count
CommandBars(I).Enabled = True
Next I
DoCmd.SelectObject acTable, , True
DoCmd.Quit
End Sub

If you just do a close database button, you will not be able to get to your own forms again without pulling the information from a fresh database.

If you create a password protected administrator section, you can create a button that closes all windows, then sets the settings back to normal so you can edit the database.
Here's the code I use for my admin button:
Code:
Private Sub Admin_Click()
Dim PassWord As String
   PassWord = InputBox("Enter Administrator Password")
   If PassWord = "drowssap" Then
      ' Open Form
      DoCmd.OpenForm "Administrator", acNormal, , , , acDialog
   Else
      MsgBox ("Wrong password")
   End If
End Sub
Here's the code to just close all windows for the administrator form:
Code:
Private Sub CloseWindows_Click()
DoCmd.SelectObject acTable, , True
Dim I As Integer
For I = 1 To CommandBars.Count
CommandBars(I).Enabled = True
Next I
DoCmd.Close acForm, "Administrator", acSaveNo
DoCmd.Close acForm, "Main Menu", acSaveNo
End Sub

I like this code because it hides everything and keeps the investigative fingers from destroying my work while providing an easy access for me to update the database.
Hopefully you find what you're looking for.
 

Users who are viewing this thread

Back
Top Bottom