How to make your own custom tool bar (1 Viewer)

TaiChi56

Registered User.
Local time
Yesterday, 18:11
Joined
Nov 4, 2004
Messages
22
If I wanted to build a database in Access can I make my own file bar. Let's say that I wanted to build a gun inventory but wanted the tool bar at the top to have the specific files I want people to click on. How is this done? Is it done with another program used as a developer with Access database? Hope this makes sense.
 

Smart

Registered User.
Local time
Today, 02:11
Joined
Jun 6, 2005
Messages
436
Hope this isn't to confusing but its the best I can do

Tools
Customize
Toolbars

Select New and give it a name (Menu appears to the right of the new button)
Drag the menu bar to the top of the screen (under the existing menu bar)


Click on commands Tab
Select New menu from the drop down list
New menu appears in the command section
Drag the new menu to the New Menu bar
Right click on it and rename it (&denotes hot key)
Eg rename it &File
From the categories box select File then drag from commands box the bits you want and drop them into the new menu named File (whilst hovering over file a blank field will appear below it drop in there
 

TaiChi56

Registered User.
Local time
Yesterday, 18:11
Joined
Nov 4, 2004
Messages
22
I was not clear about the tool bar

Smart said:
Hope this isn't to confusing but its the best I can do

Tools
Customize
Toolbars

Select New and give it a name (Menu appears to the right of the new button)
Drag the menu bar to the top of the screen (under the existing menu bar)


Click on commands Tab
Select New menu from the drop down list
New menu appears in the command section
Drag the new menu to the New Menu bar
Right click on it and rename it (&denotes hot key)
Eg rename it &File
From the categories box select File then drag from commands box the bits you want and drop them into the new menu named File (whilst hovering over file a blank field will appear below it drop in there

Excellent instuctions for making a toolbar, thank you. But I was not completely clear. I want only the custom bars I make to show when a user opens my database. I am doing a gun inventory. I saw one program that does gun inventory and when you open it, it has a custom toolbar at the top. It does not have any of the access toolbars.

Is this being done in another program, like maybe Visual Studios? Are can it be made in the Access environment. Hope this makes sense. Thank you.
 

ghudson

Registered User.
Local time
Yesterday, 21:11
Joined
Jun 8, 2002
Messages
6,194
Check this out for a few tricks... hide all Access tool bars and menu bars

Here is my prefered method for more control...
Code:
Public Function ToolbarsOff()
On Error GoTo Err_ToolbarsOff

    DoCmd.ShowToolbar "Menu Bar", acToolbarNo
    DoCmd.ShowToolbar "Database", acToolbarNo
    DoCmd.ShowToolbar "Relationship", acToolbarNo
    DoCmd.ShowToolbar "Table Design", acToolbarNo
    DoCmd.ShowToolbar "Table Datasheet", acToolbarNo
    DoCmd.ShowToolbar "Query Design", acToolbarNo
    DoCmd.ShowToolbar "Query Datasheet", acToolbarNo
    DoCmd.ShowToolbar "Form Design", acToolbarNo
    DoCmd.ShowToolbar "Form View", acToolbarNo
    DoCmd.ShowToolbar "Filter/Sort", acToolbarNo
    DoCmd.ShowToolbar "Report Design", acToolbarNo
    DoCmd.ShowToolbar "Print Preview", acToolbarNo
    DoCmd.ShowToolbar "Toolbox", acToolbarNo
    DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarNo
    DoCmd.ShowToolbar "Formatting (Datasheet)", acToolbarNo
    DoCmd.ShowToolbar "Macro Design", acToolbarNo
    DoCmd.ShowToolbar "Utility 1", acToolbarNo
    DoCmd.ShowToolbar "Utility 2", acToolbarNo
    DoCmd.ShowToolbar "Web", acToolbarNo
    DoCmd.ShowToolbar "Source Code Control", acToolbarNo
    DoCmd.ShowToolbar "Visual Basic", acToolbarNo
    
Exit_ToolbarsOff:
    Exit Function

Err_ToolbarsOff:
    If Err.Number = 2094 Then 'Can't find the toolbar. You tried to run a macro that includes a ShowToolbar action or a Visual Basic procedure that includes a ShowToolbar method.
        Resume Next
    Else
        MsgBox Err.Number & " - " & Err.Description
        Resume Exit_ToolbarsOff
    End If

End Function
Code:
Public Function ToolbarsOn()
On Error GoTo Err_ToolbarsOn
    
    DoCmd.ShowToolbar "Menu Bar", acToolbarYes
    DoCmd.ShowToolbar "Database", acToolbarWhereApprop
    DoCmd.ShowToolbar "Relationship", acToolbarWhereApprop
    DoCmd.ShowToolbar "Table Design", acToolbarWhereApprop
    DoCmd.ShowToolbar "Table Datasheet", acToolbarWhereApprop
    DoCmd.ShowToolbar "Query Design", acToolbarWhereApprop
    DoCmd.ShowToolbar "Query Datasheet", acToolbarWhereApprop
    DoCmd.ShowToolbar "Form Design", acToolbarWhereApprop
    DoCmd.ShowToolbar "Form View", acToolbarWhereApprop
    DoCmd.ShowToolbar "Filter/Sort", acToolbarWhereApprop
    DoCmd.ShowToolbar "Report Design", acToolbarWhereApprop
    DoCmd.ShowToolbar "Print Preview", acToolbarWhereApprop
    DoCmd.ShowToolbar "Toolbox", acToolbarWhereApprop
    DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarWhereApprop
    DoCmd.ShowToolbar "Formatting (Datasheet)", acToolbarWhereApprop
    DoCmd.ShowToolbar "Macro Design", acToolbarWhereApprop
    DoCmd.ShowToolbar "Utility 1", acToolbarWhereApprop
    DoCmd.ShowToolbar "Utility 2", acToolbarWhereApprop
'    DoCmd.ShowToolbar "Web", acToolbarWhereApprop 'I never allow this one because I hight use hyperlinks
    DoCmd.ShowToolbar "Source Code Control", acToolbarWhereApprop
    DoCmd.ShowToolbar "Visual Basic", acToolbarWhereApprop
    
Exit_ToolbarsOn:
    Exit Function

Err_ToolbarsOn:
    If Err.Number = 2094 Then 'Can't find the toolbar. You tried to run a macro that includes a ShowToolbar action or a Visual Basic procedure that includes a ShowToolbar method.
        Resume Next
    Else
        MsgBox Err.Number & " - " & Err.Description
        Resume Exit_ToolbarsOn
    End If

End Function
 

TaiChi56

Registered User.
Local time
Yesterday, 18:11
Joined
Nov 4, 2004
Messages
22
Where do I put this code?

Thank you for the code. I went to my splash screen form and inputted the code in a new module. I am new at this. Was that what I was suppose to do? It asks me to save it and name it. I need to have a reference somewhere to let it know to run the code correct? I am a newb, so I am lost. Thank you.
 

ghudson

Registered User.
Local time
Yesterday, 21:11
Joined
Jun 8, 2002
Messages
6,194
Place the code [sub or function] you want to use in the OnOpen event of your splash screen form.
 

TaiChi56

Registered User.
Local time
Yesterday, 18:11
Joined
Nov 4, 2004
Messages
22
Excellent, it worked

ghudson said:
Place the code [sub or function] you want to use in the OnOpen event of your splash screen form.

Excellent, thank you for the help. It worked great.
 

Users who are viewing this thread

Top Bottom