Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Custom toolbar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gerry - 10 Jan 2008 15:55 GMT
I created a custom toolbar in Access XP and have recently upraded to Access
2007. The custom toolbar is now found in the add-ins tab. However, I would
like to be able to move the custom toolbar so that it can be positioned
anywhere on the screen. Is this possible?

Thanks,

Gerry
Dale Fye - 10 Jan 2008 16:54 GMT
Gerry,

Check out the thread "Does anyone understand toolbars" in the Access
Database Forms newsgroup.  I've started creating my toolbars (popup) in code
rather than using the View - Toolbars - Customize menu option.  I find this
to be more flexible, and portable than the other methods.  Once you have a
toolbar, menu, or shortcut menu created with code, you can display it any
time you want, and if it is a popup, you can actually position it where you
want using the "ShowPopup" method of the CommandBars object.  Sample code
follows:

Const BarPopup = 5
Const ControlButton = 1
Const ControlEdit = 2
Const ControlComboBox = 4
Const ButtonUp = 0
Const ButtonDown = -1

Public Sub ReportMenu()

   Dim cbr As Object
   Dim cbrButton As Object
   Dim strSQL As String
   Dim rs As DAO.Recordset

   On Error Resume Next
   CommandBars("MyReportMenu").Delete
   On Error GoTo ReportMenuError

   Set cbr = CommandBars.Add("MyReportMenu", BarPopup, , True)

   With cbr

       Set cbrButton = cbr.Controls.Add(ControlButton, , , , True)
       With cbrButton
           .Caption = "&Print"
           .Tag = "Print"
           .OnAction = "=fnPrintReport()"
       End With

       Set cbrButton = cbr.Controls.Add(ControlButton, , , , True)
       With cbrButton
           .Caption = "&Close"
           .Tag = "Close"
           .OnAction = "=fnCloseReport()"
       End With

   End With

   Exit Sub
ReportMenuError:
   MsgBox "ReportMenu error" & vbCrLf
End Sub

Signature

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.

> I created a custom toolbar in Access XP and have recently upraded to Access
> 2007. The custom toolbar is now found in the add-ins tab. However, I would
[quoted text clipped - 4 lines]
>
> Gerry
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.