Tuesday, October 19, 2010

Protecting Your Application when Upgrading to Access 2010 from Access 2003

Here is a question and answer from the UK Access Users Group
I am not a huge fan of Switchboard Manager in Access but it does save a bit of form coding and does serve a purpose. Anyway, I have one in an Access 2003 application which works fine.

Today, I opened the 2003 application in Access 2010 for the first time.

Our company it moving to 2010 early next year so I am playing. I was quite expecting to have to upgrade the application to 2010 or at least, recompile it but I didn't seem to need to.

Once I got around the Security Macros stuff all was fine but a strange thing happened with the Switchboard Manager form.

The application opens with a Home (Startup) form and that looked fine with just the ribbon visible at the top (not sure about the ribbon being visible for a deployed [shipped] application). A button is available on the Home form that opens the Switchboard Manager. When the SB Mgr form opened, the left hand navigation pane was suddenly visible with access to all the database objects - tables, forms, queries, modules etc.

Has anyone experienced this or have any ideas about stopping the Navigation pane suddenly appearing? I don't want Users poking around in the queries etc.

Thanks,  Andy.

A. from Bob Cresswell

I hide the ribbon
DoCmd.ShowToolbar "Ribbon", acToolbarNo

and disable the Bypass Key on Startup (as I am Macro-intolerant these statements are in my Splash form which is the start up form in the application).

SetProperties "AllowByPassKey", dbBoolean, False

The Navigation Pane is hidden using the Access Options.

For authorised users, I have an option on the Main Menu (or Switchboard) that gives them options to show the ribbon, navigation pane and enable the Bypass key (close database and restart with shift required for this).

I have three check boxes on the form, and an Apply button has this code:

' Show/Hide Ribbon
If Me!chkShowRibbon Then
  DoCmd.ShowToolbar "Ribbon", acToolbarYes
  DoCmd.ShowToolbar "Ribbon", acToolbarNo
End If

' Enable/Disable Bypass Key

SetProperties "AllowBypassKey", dbBoolean, Me!chkBypassKey

' Show/Hide Navigation Pane

If Me!chkShowNavigationPane Then
  Application.SetOption "Show Navigation Pane Search Bar", True
  DoCmd.SelectObject acTable, , True

  DoCmd.SelectObject acTable, "tCATVersion", True
  DoCmd.RunCommand acCmdWindowHide
End If

No comments: