CommandBarControl

  • Thread starter Thread starter Dale
  • Start date Start date
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
 
Just upgraded to XP? Error message reads: "User-defined type not defined"?

In the VBE, check your references and make sure you have a reference to the
Microsoft Office 10.0 Object library checked.
 
It is checked. I think it has to do with the code not being coded
correctly but it has been years since I did this so I do not remember
what all I did.
 
Back
Top