Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 4th, 2008, 04:05 AM
Friend of Wrox
 
Join Date: Apr 2007
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
Send a message via MSN to ayazhoda
Default Error with Access Menus


I am trying to find a way to load customize menu, as defined in Ribbon UI Customization in Access 2007.

An Autoexec macro that calls that procedure by using Runcode action

Function LoadRibbons()
Dim i As Integer
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = Application.CurrentDb

uid = CUser()

If uid = 66 Then
            For i = 0 To (db.TableDefs.count - 1)
                 If (InStr(1, db.TableDefs(i).Name, "Ribbons")) Then

                    Set rs = CurrentDb.OpenRecordset(db.TableDefs(i).Name)
                    rs.MoveFirst
                    While Not rs.EOF
                    MsgBox "User ribbon"
                    Application.LoadCustomUI rs("RibbonName").Value, rs("RibbonXml").Value ' Error on this line Runtime error 32609, Cannot load customization 'test2' this customization was already loaded

                 Wend

              rs.Close
              Set rs = Nothing
           End If
        Next i

  End If

db.Close
Set db = Nothing
End Function

Please any suggestion or advice

Thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
VB Error: Syntax Error or Access Violation codehappy VB How-To 7 October 3rd, 2007 05:41 PM
HTML menus BrendonMelville HTML Code Clinic 3 March 14th, 2006 10:51 AM
sub menus matshediso HTML Code Clinic 2 January 31st, 2005 05:15 AM
Javascript menus alancdude Javascript 5 November 26th, 2003 11:58 AM
Menus Frank Schmuck BOOK: Beginning ASP.NET 1.0 1 June 6th, 2003 01:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.