CommandBar Location

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to program the location of a command bar such that it would
always appear on the second row beneath the menu bar at the left side of the
window, without forcing existing bars to a lower level, but rather to the
right of the same row?

Cheers
 
Doh,

Found the answer in Chapter 11 of the Access Developers Handbook 1 on
'Working with commandbars'

Set the rowindex property of the commandbar.

Cheers anyway folks
 
Here's an excerpt from the code I used

Public Sub refreshReportToolbar(Optional fDropBar As Boolean = False)
Dim cbr As CommandBar
Dim cbb As CommandBarButton
Dim cbc As CommandBarComboBox

Dim rs As ADODB.Recordset
Dim conn As ADODB.Connection

If fDropBar = True Then
On Error Resume Next
CommandBars("Guide Tools").Delete
Set cbr = CommandBars.Add("Guide Tools", msoBarTop)
With cbr
.RowIndex = 1 'You can also search for rowindex in the online
help
'.Top = -10
'.Left = -10
.Controls(1).Delete
.Controls(2).Delete
.Controls(3).Delete
End With
*** end excerpt***


Hope that helps some
 
Back
Top