Re: Custom Menus almost working
From: jonefer (jonefer_at_discussions.microsoft.com)
Date: 12/22/04
- Next message: Allen Browne: "Re: FindFirst"
- Previous message: Dan Artuso: "Re: Page thru Listbox"
- In reply to: PC Data***: "Re: Custom Menus almost working"
- Next in thread: PC Data***: "Re: Custom Menus almost working"
- Reply: PC Data***: "Re: Custom Menus almost working"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 21 Dec 2004 18:47:01 -0800
Ok, I created my custom bar called "ReportView" - it only has a close button
on it
But the Menu Bar is still there - I don't want to show the menu bar.
Also, what do you mean by "Default Menu" property?
The 'other' tab only has:
Menu Bar
Toolbar
Shortcut Menu Bar
I didn't see anything about 'Default Menu'
"PC Data***" wrote:
> You're doing it the HARD way!!
>
> Just create a custom menu with only a Close button. Make sure the custom
> menu is a menubar. Open the report, go to properties and the Other tab, set
> the Default Menu property to the name of the custom menu you just created.
> When you open the report, the custom menu will appear at the top of the
> screen. You can also do this with forms.
>
> --
> PC Data***
> Your Resource For Help With Access, Excel And Word Applications
> resource@pcdata***.com
> www.pcdata***.com
>
>
> "jonefer" <jonefer@discussions.microsoft.com> wrote in message
> news:319662C0-BF4F-4F6E-9317-E1EFDD2793B2@microsoft.com...
> > I have 2 routines that almost produce the results I want.
> >
> > 1) EnableDefaultMenu () ---just resets everything
> > 2) InvokeUserMenu () ---almost works - but probably serendipitously
> >
> >
> > I have a startup routine that checks users and sets their menu, because
> the
> > "ChangeProperty" routine I tried will only work after the NEXT time the
> > database is open. The above routines happen immediately.
> >
> > The InvokeUserMenu effectively removes the other menus I dont' want them
> to
> > see, so I probably don't need the inner loop. (It doesn't even touch it)
> >
> > It boils down to - It sure would be nice if whenever a report is open the
> > only button a user sees is the "CLOSE" button - the one that closes the
> > report (not exit, or any other button or menu)
> >
> > If anyone has CommandBar down to a science, please help me figure out how
> to
> > adjust this code to get the results I want?
> >
> > 'Code provided below
> > '====================================================
> >
> > Public Sub EnableDefaultMenu()
> > On Error Resume Next
> > Dim obar As CommandBar
> >
> > For Each obar In Application.CommandBars
> > obar.Reset
> > Next
> > End Sub
> >
> >
> > Public Sub InvokeUserMenu()
> > Dim cbarMenu As CommandBar
> > Dim cbarControl As CommandBarControl
> > Dim strBar As String
> > Dim strList As String
> >
> > On Error Resume Next
> > For Each cbarMenu In Application.CommandBars
> >
> > For Each cbarControl In cbarMenu.Controls 'command bars
> > If cbarControl.Caption = "&File" Or cbarControl.Caption =
> "&Edit"
> > Or cbarControl.Caption = "&Window" Then 'parent menus
> > 'MsgBox "Parent Menu: " & cbarControl.Caption
> > MsgBox "Will Keep this menu: " & cbarControl.Caption
> > '====================== 'menu items
> > If cbarControl.Type = msoBarTypeMenuBar Then
> > 'If cbarControl.Enabled = True Then
> >
> > ' MsgBox "menu item: " & cbarControl.Caption
> > If cbarControl.Caption = "&Close" Or _
> > cbarControl.Caption = "&Print" Or _
> > cbarControl.Caption = "&Find..." Or _
> > cbarControl.Caption = "R&eplace..." Or _
> > cbarControl.Caption = "Ti&le Horizontally"
> Or _
> > cbarControl.Caption = "&Tile Vertically" Or
> _
> > cbarControl.Caption = "&Cascade" Or _
> > cbarControl.Caption = "Microsoft Access
> &Help"
> > Then
> >
> > 'any item from the above list should be
> enabled
> > MsgBox "Will keep this menu item: " &
> > cbarControl.Caption
> >
> > Else ' not a chosen menu item
> > cbarControl.Visible = False
> > End If
> > 'End If 'item was enabled
> > End If 'checking if it is a menuitem
> >
> >
> > '=====================
> > Else 'if not one of the chosen menus... disable it
> >
> > cbarControl.Visible = False
> > End If
> > Next
> >
> > Next
> >
> > Set cbarMenu = Nothing
> > End Sub
>
>
>
- Next message: Allen Browne: "Re: FindFirst"
- Previous message: Dan Artuso: "Re: Page thru Listbox"
- In reply to: PC Data***: "Re: Custom Menus almost working"
- Next in thread: PC Data***: "Re: Custom Menus almost working"
- Reply: PC Data***: "Re: Custom Menus almost working"
- Messages sorted by: [ date ] [ thread ]