D
Dale
Here is some code I used to use in an Access 2000 database. I have
upgraded it to Access XP. The code no longer works. The
cbrctl.CommandBar section gives an error about the object not being
supported. Any help is appreciated.
Public Sub listbar(Level As Integer, thisbar As CommandBar, rcs As
Recordset)
Dim cbrctl As CommandBarControl
For Each cbrctl In thisbar.Controls
rcs.MoveFirst
While (Not rcs.EOF And Not rcs.BOF)
If cbrctl.Caption = rcs("oldlabel").Value Then
cbrctl.Caption = rcs("newlabel").Value
rcs.MoveNext
Wend
' If the control doesn't have a command bar associated
' with it, then don't print it.
If cbrctl.Type <> 1 And cbrctl.Type <> 2 And cbrctl.Type <> 4
And cbrctl.Type <> 16 And cbrctl.Type <> 18 Then
listbar Level + 1, cbrctl.CommandBar, rcs
End If
Next cbrctl
End Sub
Dale
upgraded it to Access XP. The code no longer works. The
cbrctl.CommandBar section gives an error about the object not being
supported. Any help is appreciated.
Public Sub listbar(Level As Integer, thisbar As CommandBar, rcs As
Recordset)
Dim cbrctl As CommandBarControl
For Each cbrctl In thisbar.Controls
rcs.MoveFirst
While (Not rcs.EOF And Not rcs.BOF)
If cbrctl.Caption = rcs("oldlabel").Value Then
cbrctl.Caption = rcs("newlabel").Value
rcs.MoveNext
Wend
' If the control doesn't have a command bar associated
' with it, then don't print it.
If cbrctl.Type <> 1 And cbrctl.Type <> 2 And cbrctl.Type <> 4
And cbrctl.Type <> 16 And cbrctl.Type <> 18 Then
listbar Level + 1, cbrctl.CommandBar, rcs
End If
Next cbrctl
End Sub
Dale