开发者

How to Hide Ribbon except when deving

开发者 https://www.devze.com 2023-03-16 20:08 出处:网络
I am using Access 2007 and creating an invoicing system for my parent\'s business.When I\'m developing in Access, I would like to be able to see the ribbon nav, and also the object nav over on the lef

I am using Access 2007 and creating an invoicing system for my parent's business. When I'm developing in Access, I would like to be able to see the ribbon nav, and also the object nav over on the left. When I push it out to them for their use, I would like to hide all of that junk.

Is there an easy way to enter an access DB as a "dev" giving my all of the options, but when opened 开发者_如何学Pythonby an end user, all they see are the forms that I have AutoExec'd to open when the database is opened?


To toggle the navigation pane, I use F11. To toggle the ribbon, Ctrl+F1 --- but that minimizes the ribbon rather than hides it completely.

If you want to do similar with VBA code:

'hide the navigation pane
DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowHide

'unhide the navigation pane
DoCmd.SelectObject acTable, , True

'hide ribbon
Docmd.ShowToolBar "Ribbon",acToolBarNo

'unhide ribbon
Docmd.ShowToolBar "Ribbon",acToolBarYes

An easy way to distinguish between the development and production versions of your application is to place them in separate folders.

If CurrentProject.Path Like "*Dev*" Then
    'do what you want for development mode
Else
    'do what you want for production mode
End If

If that doesn't work for you, there are many alternatives.

A table where you store the status, retrieve the status at startup, and do your adjustments based on the status.

Same approach, but using a database property instead of a table.

A module variable which your code checks to determine the status.

Those are a few, but you can come up with plenty more if you're motivated.

0

精彩评论

暂无评论...
验证码 换一张
取 消