My Access database has an autoexec macro which opens a main menu (Form). All necessary functions are menu (form)-controlled, and I want to hide the Access Window so that only the forms are displayed. I was referred to http://www.tek-tips.com/faqs.cfm?fid=2562 but this doesn't work with later versions. Is there a snippet which will work for Access 2007-2013?
To hide dimmed objects or groups Right-click the menu bar at the top of the Navigation Pane, and then click Navigation Options. In the Navigation Options dialog box, clear the Show Hidden Objects check box, and then click OK.
Go to Access settings=> document window options and select tabbed documents . Any form you want to have specific size, you can then set as "popup". You can still have your custom form with custom bg colour, size 1cmx1cm, no scroll, no navigation bar, no record selctor, borderstyle none .
This is the code I run in my Acc 2003 and 2007 Apps, running in 2010 environment:
Private Sub Form_Load()
'Hide Data-Base Window:
DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowHide
'...Other Actions...
end sub
For hiding the ribbon in 2007 and higher use this line I found here:
DoCmd.ShowToolbar "Ribbon", acToolbarNo
It seems your goal is to restrict the Access UI features which are available to the user of your database. You want to limit them to the options which you provide via your startup form.
In that case, take a copy of your ACCDB file and change its file extension to ACCDR. Then when you open the ACCDR from Windows Explorer, Access will open it in "runtime mode". Runtime mode suppresses most of the standard UI options. For example, the Navigation pane is not displayed, and can't even be opened. Also it gives you a very minimal version of the Ribbon; the majority of the standard Ribbon options are gone.
Runtime mode has other consequences which you should investigate to see whether it's a good fit for your needs. One important issue is runtime mode will quit the application when an unhandled error is encountered.
If ACCDR/runtime mode suits your particular situation, it is an inexpensive way to limit the database UI features. However, beware a user could make a copy of the ACCDR and change the file extension back to ACCDB, so this approach alone may not satisfy your security requirements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With