NigelShaw
03-06-2011, 09:25 AM
Hi,
for all you A2007 users.
After designing my form all nice and proportioned, i did a few final views with no NAV bar then with no ribbon only to find i had to have a re-think....
i dont want a ribbon or nav bar on my finished program so i made this simple temp button that you can add to a form while in design period and quickly switch between design and no nav or ribbon to see how the design works.
Procedure
1. Add a button (without the wizard)
2. Add this code behind it
Dim strForm As String
strForm = "frmMain"
Select Case bolpress
Case False
DoCmd.SelectObject acForm, strForm, True
DoCmd.ShowToolbar "Ribbon", acToolbarYes
bolpress = True
Case True
DoCmd.SelectObject acForm, strForm, True
DoCmd.RunCommand acCmdWindowHide
DoCmd.ShowToolbar "Ribbon", acToolbarNo
bolpress = False
Case Else
bolpress = True
End Select
3. Make this variable public
Public bolPress As Boolean
4. Change this line to represent your form. My form is called frmMAIN
strForm = "frmMain"
Now you can easily switch between ribbon / no ribbon & nav bar / no nav bar without having to go through the motions
Cheers
Nigel
for all you A2007 users.
After designing my form all nice and proportioned, i did a few final views with no NAV bar then with no ribbon only to find i had to have a re-think....
i dont want a ribbon or nav bar on my finished program so i made this simple temp button that you can add to a form while in design period and quickly switch between design and no nav or ribbon to see how the design works.
Procedure
1. Add a button (without the wizard)
2. Add this code behind it
Dim strForm As String
strForm = "frmMain"
Select Case bolpress
Case False
DoCmd.SelectObject acForm, strForm, True
DoCmd.ShowToolbar "Ribbon", acToolbarYes
bolpress = True
Case True
DoCmd.SelectObject acForm, strForm, True
DoCmd.RunCommand acCmdWindowHide
DoCmd.ShowToolbar "Ribbon", acToolbarNo
bolpress = False
Case Else
bolpress = True
End Select
3. Make this variable public
Public bolPress As Boolean
4. Change this line to represent your form. My form is called frmMAIN
strForm = "frmMain"
Now you can easily switch between ribbon / no ribbon & nav bar / no nav bar without having to go through the motions
Cheers
Nigel