CommandBarControl

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
 
D

Dale

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.
 
P

PC Datasheet

In the parameters of the sub, change rcs As Recordset to rcs As
DAO.Recordset
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top