Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2005

Tip: Looking for answers? Try searching our database.

using code to copy commandbars to another database

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Henry Bromelkamp - 18 Mar 2005 07:43 GMT
I want to be able to copy commandbars from one MDB to another using code. Is
there a way to do this? I can't find any commands or methods that copy or
transfer commandbars to another database.

If possible, I'd like it to work in Access97, 2000, XP, and 2003.

Here's what I coded; it creates the commandbars, but gives Err 5 when it
tries to copy the controls. ExpObj is the application of the external
database; it works if ExpObj is the same database or I remove "ExpObj." from
the code.

               For Each exVal In CommandBars
                       Debug.Print exVal.Name
                       Set exVal2 = ExpObj.CommandBars.Add(exVal.Name)
'create new
                       For Each exCtl In exVal.Controls
                           exCtl.Copy exVal2       '<THIS GIVES ERR5 IF
exVal2 is from the external database
                       Next
               Next
Alex Dybenko - 18 Mar 2005 11:14 GMT
Hi,
here a good sample:
http://smsconsulting.spb.ru/shamil_s/topics/copycmdb.htm

Signature

Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com

>I want to be able to copy commandbars from one MDB to another using code.
>Is
[quoted text clipped - 18 lines]
>                        Next
>                Next
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.