Replacing Menul values

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

dale_at_community.nospam
Date: 02/02/05


Date: Wed, 02 Feb 2005 16:02:53 -0600

I used some code that I had gotten from a Microsoft Access newsgroup
that seemed to work in Access 2000. I have upgraded to XP and it does
not work anymore. The code is in a module is as follows. Any help is
appreciated.

Public Sub changemenu()
     Dim cmd As QueryDef
     Dim rcs As Recordset
     Set cmd = CurrentDb.QueryDefs("labelmapquery")
     Set rcs = cmd.OpenRecordset

     Dim cbr As CommandBar
       For Each cbr In CommandBars
           listbar 1, cbr, rcs
       Next cbr

End Sub
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



Relevant Pages

  • Re: VBA Font Object Query
    ... Public Sub Tester() ... Dim FontList As CommandBarComboBox ... Dim tempbar As CommandBar ... > Dim f as Font ...
    (microsoft.public.excel.programming)
  • Re: Replacing Menul values
    ... Microsoft Office 10.? ... Dim rcs As Recordset ... > Public Sub listbar(Level As Integer, thisbar As CommandBar, rcs As ...
    (microsoft.public.access.formscoding)
  • Re: Disable Cut and paste
    ... Public Sub EnableControl(Id As Integer, Enabled As Boolean) ... Dim CB As CommandBar ... Dim C As CommandBarControl ...
    (microsoft.public.excel.programming)
  • Custom Menus almost working
    ... I have 2 routines that almost produce the results I want. ... If anyone has CommandBar down to a science, please help me figure out how to ... Public Sub EnableDefaultMenu() ... Dim cbarMenu As CommandBar ...
    (microsoft.public.access.formscoding)
  • Re: Concurrency violation
    ... Public Sub SendAllSMS() ... Dim ds As New Data.DataSet ... Dim NewDat As String ... Public Property ODBC_ConnectionStringAs String ...
    (microsoft.public.de.german.entwickler.dotnet.vb)