Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Special Menu Bar not in Macro

Posted on 2000-04-14
13
Medium Priority
?
449 Views
Last Modified: 2012-06-27
Hello Experts,

Here's one for your crystal ball.

I have a database program that uses a Custom Menu.  Only I can't find where it is comming from.   I know how to create one from a macro, but there are no macros here.

Can anyone tell me how this Special Menu Bar may have been created in Access97?

Thanks,

Mac

0
Comment
Question by:MacRena
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 14

Expert Comment

by:mgrattan
ID: 2717094
When you create command bars in Access 97 they are stored in system table called MSysCmdBars
0
 
LVL 4

Author Comment

by:MacRena
ID: 2717105
Ah-Ha.  but how do I look at the design?
0
 
LVL 4

Author Comment

by:MacRena
ID: 2717111
Here is the table design:

Grptbcd = OLE Object
     contains the words "Long Binary Data"

TbName = Text
     contains the word "Form"

Mean anything to you?

Mac
0
Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

 
LVL 14

Expert Comment

by:mgrattan
ID: 2717122
TbName is simply the name you assigned to the command bar.  As for the design, you got me!  I don't think you can actually get to it since it's not in any of the listed Collections in Access.  
0
 
LVL 14

Expert Comment

by:mgrattan
ID: 2717128
I spoke too soon.  See the online help references for CommandBar Controls Collection Object.  You can build command bars in code using this collection.
0
 
LVL 14

Expert Comment

by:mgrattan
ID: 2717142
I realized that you could manipulate the command bars after I initially clicked that danged Submit button because I have actually used the Collection in an application I built last year.  In that application, I used code to loop through the menu items in a command bar and disable the ones that did not apply to the current user.  Not only can you enable/disable controls but you can add and delete controls as well.

Here's a function that tells you which controls are in the command bar that you pass:

Sub CommandBarInfo(strCBBarName As String)
    Dim cbr As CommandBar

    On Error Resume Next
    Set cbr = CommandBars(strCBBarName)
    If Err = 0 Then
        With cbr
            MsgBox "The command bar named '" & .Name & "' contains " & _
            .Controls.Count & IIf(.Controls.Count = 1, " control and ", _
            " controls and ") & IIf(.BuiltIn, "is", "is not") & _
            " a built-in toolbar", vbOKOnly, "'" & _
            .Name & "' Information:"
        End With
    Else
        MsgBox "Invalid CommandBar Name"
    End If
End Sub
0
 
LVL 4

Author Comment

by:MacRena
ID: 2717184
Searching for the word Commandbar, there is no instance of it in this code.

I told you you'd need a crystal ball.

Here's something - in the AutoExec code there is a line

    DoCmd.ShowToolbar "Form", acToolbarYes


That's it, isn't it?

But how do I look/change the design?

Could this one be an intrinsic Access default Commandbar?

When I REM out the line in AutoExec it acts exactly the same.  That also doesn't explain why the standard "Form View" toolbar is not there. (the one with the "Design View" icon - to get that I need to right-click off the page)

Somehow this program supresses "Form View" and puts up a default "Form".  I tried changing the options, but there isn't an option for that.

I can't figure out how this is being done.

Mac
0
 
LVL 14

Accepted Solution

by:
mgrattan earned 80 total points
ID: 2717210
Yes, it appears that a custom command bar is being displayed and all others are being suppressed.  The suppression is probably occuring in the Startup process.  You can prevent the Startup process from being triggered by either holding down the Shift key while opening the MDB or by renaming the Autoexec macro to something else.  After you have prevented the Startup routine from running you can go to Tools | Startup and see if this is where the menus/toolbars are being disabled.  You don't need to enable them, however, if your intent is to just make some changes to the database using the default toolbars (such as the Form Design button) and you want the users to not have access to those buttons.  You will have access to full menus and toolbars just by preventing the Startup routine from running.  You will also be able to change the toolbar design at that point by right-clicking on the toolbar area and choosing Customize and then selecting the Form toolbar.
0
 
LVL 14

Expert Comment

by:mgrattan
ID: 2717254
By the way, since you weren't able to find CommandBar in your search through the database that just indicates that the custom toolbar/menu is not being manipulated via code.  The database designer simply created a new toolbar/menu by right-clicking on the toobar area and selecting Customize and the selecting New and adding buttons to it from the Customize dialog.  No magic going on here, just basic toolbar customization and suppression of the default toolbars via the Startup routine.
0
 
LVL 4

Author Comment

by:MacRena
ID: 2717326
Thanks, mgrattan.

I didn't figure out why the standard "Form Design" menu is supressed, but I know a lot more than I did a while ago.

Thank you very much.

Mac
0
 
LVL 4

Author Comment

by:MacRena
ID: 2717335
mgrattan,

I didn't see your last entry - here's the entire Startup Module:

***************************************

Option Compare Database
Option Explicit

Global DatPath As String
Global SrcDB As DATABASE

Function AutoExec()

    '--- Check to see if Tables are correctly attached
    Dim x As Integer
    x = CheckTables()

    '--- Enter the path of program's data files
    Dim mydb As DATABASE, MyDef As TableDef, Length As Integer, CompanyName As Variant
    Set mydb = CurrentDb()
    Set MyDef = mydb.TableDefs("Orders")
    Length = Len(Trim(MyDef.Connect))
    DatPath = Right(Trim(MyDef.Connect), Length - 10) ' Remove the ;DATABASE= from the ConnectString
   
    Set SrcDB = DBEngine.Workspaces(0).OpenDatabase(DatPath)
   
    '--- Turn off the action query warnings
    Application.SetOption "Confirm Action Queries", False
    Application.SetOption "Confirm Record Changes", False
   
    '--- Display Toolbar
    DoCmd.ShowToolbar "Form", acToolbarYes
   
End Function


***************************************
That's all there is.  I don't see where the "Form View" toolbar is being supressed here.

Mac
0
 
LVL 14

Expert Comment

by:mgrattan
ID: 2717711
On your menu bar select Tools, Startup.  That's where you should see whether the option to Allow Default Toolbars is checked or not.  If it's not checked, you will see the default toolbar on your screen when you have an object open in Design view.  If you don't have the object open in Design view then you will see only the toolbar that has been assigned to that object (form or report) in that object's MenuBar or ToolBar property.
0
 
LVL 4

Author Comment

by:MacRena
ID: 2728881
Yes!  Exactly right!  Thank you!  
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question