<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Well, I don't think it does what I'm after. Your
code seems to refer to the command bar and its controls -- I'm looking for the
controls' controls. For instance: </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Menu bar: File: New, Open, SaveAs..., </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm trying to loop through New, Open, Save As, and
so on. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Susan H. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><BR> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"><BR><FONT
face=sans-serif size=2>Susan,</FONT> <BR><BR><FONT face=sans-serif size=2>Here
is some code that might help. You will need to modify it as I just took
it out of one of my programs that calls it to hide ALL command bars,
etc.</FONT> <BR><BR><FONT face=sans-serif size=2>I hope this helps.</FONT>
<BR><BR><BR><FONT face=sans-serif size=2>Sub hideCommandBars()</FONT>
<BR><FONT face=sans-serif size=2> Dim cbr As CommandBar</FONT>
<BR><FONT face=sans-serif size=2> For Each cbr In
CommandBars</FONT> <BR><FONT face=sans-serif size=2>
hidebar cbr</FONT> <BR><FONT face=sans-serif size=2> Next
cbr</FONT> <BR><FONT face=sans-serif size=2>End Sub</FONT> <BR><FONT
face=sans-serif size=2>Sub listbar(level As Integer, thisbar As
CommandBar)</FONT> <BR><FONT face=sans-serif size=2> Dim cbrctl
As CommandBarControl</FONT> <BR><FONT face=sans-serif size=2> Dim
indent As Integer</FONT> <BR><FONT face=sans-serif size=2> '
Indent the command bar depending on its level in</FONT> <BR><FONT
face=sans-serif size=2> ' the menu structure.</FONT> <BR><FONT
face=sans-serif size=2> For indent = 1 To level</FONT> <BR><FONT
face=sans-serif size=2> MsgBox " "</FONT>
<BR><FONT face=sans-serif size=2> Next indent</FONT> <BR><FONT
face=sans-serif size=2> Select Case thisbar.Type</FONT> <BR><FONT
face=sans-serif size=2> Case
msoBarTypeMenuBar</FONT> <BR><FONT face=sans-serif size=2>
MsgBox "Menu Bar: " & thisbar.name</FONT> <BR><FONT
face=sans-serif size=2> Case
msoBarTypeNormal</FONT> <BR><FONT face=sans-serif size=2>
MsgBox "Toolbar: " & thisbar.name</FONT> <BR><FONT
face=sans-serif size=2> Case msoBarTypePopup</FONT>
<BR><FONT face=sans-serif size=2>
MsgBox "Popup: " & thisbar.name</FONT> <BR><FONT face=sans-serif
size=2> End Select</FONT> <BR><FONT face=sans-serif size=2>
For Each cbrctl In thisbar.Controls</FONT> <BR><FONT face=sans-serif
size=2> ' If the control doesn't have a command bar
associated</FONT> <BR><FONT face=sans-serif size=2> ' with it,
then don't print it.</FONT> <BR><FONT face=sans-serif size=2>
If cbrctl.Type <> 1 And cbrctl.Type <> 2 _</FONT>
<BR><FONT face=sans-serif size=2>
And cbrctl.Type <> 4 And cbrctl.Type <> 16 _</FONT>
<BR><FONT face=sans-serif size=2>
And cbrctl.Type <> 18 Then</FONT> <BR><FONT face=sans-serif
size=2> listbar level + 1,
cbrctl.CommandBar</FONT> <BR><FONT face=sans-serif size=2>
End If</FONT> <BR><FONT face=sans-serif size=2> Next
cbrctl</FONT> <BR><FONT face=sans-serif size=2>End Sub</FONT> <BR><FONT
face=sans-serif size=2>Sub hidebar(thisbar As CommandBar)</FONT> <BR><FONT
face=sans-serif size=2> Dim cbrctl As CommandBarControl</FONT>
<BR><FONT face=sans-serif size=2> Dim indent As Integer</FONT>
<BR><FONT face=sans-serif size=2> ' Indent the command bar
depending on its level in</FONT> <BR><FONT face=sans-serif size=2>
' the menu structure.</FONT> <BR><FONT face=sans-serif size=2>
For indent = 1 To level</FONT> <BR><FONT face=sans-serif size=2>
MsgBox " "</FONT> <BR><FONT face=sans-serif
size=2> Next indent</FONT> <BR><FONT face=sans-serif
size=2> Select Case thisbar.Type</FONT> <BR><FONT face=sans-serif
size=2> Case msoBarTypeMenuBar</FONT> <BR><FONT
face=sans-serif size=2>
DoCmd.ShowToolbar thisbar.name, acToolbarNo</FONT> <BR><FONT face=sans-serif
size=2> Case msoBarTypeNormal</FONT> <BR><FONT
face=sans-serif size=2>
DoCmd.ShowToolbar thisbar.name, acToolbarNo</FONT> <BR><FONT face=sans-serif
size=2> Case msoBarTypePopup</FONT> <BR><FONT
face=sans-serif size=2>
DoCmd.ShowToolbar thisbar.name, acToolbarNo</FONT> <BR><FONT face=sans-serif
size=2> End Select</FONT> <BR><FONT face=sans-serif size=2>
For Each cbrctl In thisbar.Controls</FONT> <BR><FONT face=sans-serif
size=2> ' If the control doesn't have a command bar
associated</FONT> <BR><FONT face=sans-serif size=2> ' with it,
then don't print it.</FONT> <BR><FONT face=sans-serif size=2>
If cbrctl.Type <> 1 And cbrctl.Type <> 2 _</FONT>
<BR><FONT face=sans-serif size=2>
And cbrctl.Type <> 4 And cbrctl.Type <> 16 _</FONT>
<BR><FONT face=sans-serif size=2>
And cbrctl.Type <> 18 Then</FONT> <BR><FONT face=sans-serif
size=2> listbar level + 1,
cbrctl.CommandBar</FONT> <BR><FONT face=sans-serif size=2>
End If</FONT> <BR><FONT face=sans-serif size=2> Next
cbrctl</FONT> <BR><FONT face=sans-serif size=2>End Sub</FONT> <BR><BR><BR>
<TABLE width="100%">
<TBODY>
<TR vAlign=top>
<TD>
<TD><FONT face=sans-serif size=1><B>"Susan Harkins"
<harkins@iglou.com></B></FONT> <BR><FONT face=sans-serif
size=1>Sent by: accessd-bounces@databaseadvisors.com</FONT>
<P><FONT face=sans-serif size=1>04/07/2003 02:47 PM</FONT> <BR><FONT
face=sans-serif size=1>Please respond to accessd</FONT> <BR></P>
<TD><FONT face=Arial size=1> </FONT><BR><FONT
face=sans-serif size=1> To:
AccessD@databaseadvisors.com</FONT> <BR><FONT
face=sans-serif size=1> cc:
</FONT> <BR><FONT face=sans-serif size=1>
Subject: [AccessD]
CommandBarControl subitems</FONT></TR></TBODY></TABLE><BR><BR><BR><FONT
face="Courier New" size=2>If a CommandBarControl on a menu bar contains
submenus, how do I cycle<BR>through that control's collection to list the
submenus? This is driving me<BR>nuts -- I can't figure out how to reference a
control's Collection -- does a<BR>control have a collection? I'm assuming it
does if there are submenus?????<BR><BR><BR>Dim cbarMenu As
CommandBar<BR> Dim cbarControl As CommandBarControl<BR> Dim cbarSub
As CommandBarControl<BR> 'Dim cbarcolControls As
CommandBarControls<BR> Set cbarMenu = CommandBars(barname)<BR> For
Each cbarControl In cbarMenu.Controls<BR> If cbarControl.Id =
controlname Then<BR> For Each control in cbarControl's
collection...<BR><BR><BR>This is where I get lost -- at this point, I need to
declare cbarControl's<BR>collection, and I can't get it.<BR><BR><BR>Susan
H.<BR><BR>_______________________________________________<BR>AccessD mailing
list<BR>AccessD@databaseadvisors.com<BR>http://databaseadvisors.com/mailman/listinfo/accessd<BR>Website:
http://www.databaseadvisors.com<BR><BR></FONT><BR><BR>
<P>
<HR>
<P></P>_______________________________________________<BR>AccessD mailing
list<BR>AccessD@databaseadvisors.com<BR>http://databaseadvisors.com/mailman/listinfo/accessd<BR>Website:
http://www.databaseadvisors.com<BR></BLOCKQUOTE></BODY></HTML>