Ö
Ömer Ayzan
Dear Friends,
I am a Access 2000 user, running under WinXP professional.
I have created a custom menu bar by using customize menu bar and assigned
it to all of my forms as the only menubar.
However on a certain form I want that menu bar hidden. So on the activate
event of this form I have the following code:
Private Sub Form_Activate()
MBarUtil "ptsMenuBar", False
End Sub
and the function is:
Public Function MBarUtil(MBar as string,Visibility As Boolean)
Dim cmdbar As CommandBar
Set cmdbar = Application.CommandBars(MBar )
With cmdbar
.Visible = Visibility
.Position = msoBarTop
End With
End Function
References to access are:
- Visual Basic For Applications
- Microsoft Access 9.0 Object Library
- OLE Automation
- Microsoft ActiveX Data Objects 2.1 Library
- Microsoft Office 9.0 Object Library
So far very simple, but when the form is open even though the function sets
the visibility of the menu bar to false Menu bar is still shown.
However when I click on a different form then this form again thereby
inactivating and reactivating it, the menu bar is hidden.
How can I fix this problem so that when the form is first open its menu bar
is hidden
Thanking in advance,
Omer Ayzan.
I am a Access 2000 user, running under WinXP professional.
I have created a custom menu bar by using customize menu bar and assigned
it to all of my forms as the only menubar.
However on a certain form I want that menu bar hidden. So on the activate
event of this form I have the following code:
Private Sub Form_Activate()
MBarUtil "ptsMenuBar", False
End Sub
and the function is:
Public Function MBarUtil(MBar as string,Visibility As Boolean)
Dim cmdbar As CommandBar
Set cmdbar = Application.CommandBars(MBar )
With cmdbar
.Visible = Visibility
.Position = msoBarTop
End With
End Function
References to access are:
- Visual Basic For Applications
- Microsoft Access 9.0 Object Library
- OLE Automation
- Microsoft ActiveX Data Objects 2.1 Library
- Microsoft Office 9.0 Object Library
So far very simple, but when the form is open even though the function sets
the visibility of the menu bar to false Menu bar is still shown.
However when I click on a different form then this form again thereby
inactivating and reactivating it, the menu bar is hidden.
How can I fix this problem so that when the form is first open its menu bar
is hidden
Thanking in advance,
Omer Ayzan.