dbTalk Databases Forums  

Does anyone understand toolbars?

comp.databases.ms-access comp.databases.ms-access


Discuss Does anyone understand toolbars? in the comp.databases.ms-access forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Neil
 
Posts: n/a

Default Does anyone understand toolbars? - 11-10-2007 , 07:25 AM






So, I tried to copy a toolbar. I have a custom menu bar for a form. Tried to
copy it so that I could modify the copy and use it with another form. With
no direct way to copy it, I made a copy of the MDB, renamed the toolbar, and
then imported it back into the original MDB as a copy of the original (see
"Copying a custom menu bar" thread here). Everything seemed fine until I
tried to modify the copy. When I added or removed items from the menu bar,
the original was modified as well! They were one toolbar with two instances
in the db.

So I'm back to where I started. Anyone know of a way to make a copy of a
toolbar so that I can modify it and use a slightly different version with
another form?



Reply With Quote
  #2  
Old   
Rick Brandt
 
Posts: n/a

Default Re: Does anyone understand toolbars? - 11-10-2007 , 07:38 AM






Neil wrote:
Quote:
So, I tried to copy a toolbar. I have a custom menu bar for a form.
Tried to copy it so that I could modify the copy and use it with
another form. With no direct way to copy it, I made a copy of the
MDB, renamed the toolbar, and then imported it back into the original
MDB as a copy of the original (see "Copying a custom menu bar" thread
here). Everything seemed fine until I tried to modify the copy. When
I added or removed items from the menu bar, the original was modified
as well! They were one toolbar with two instances in the db.

So I'm back to where I started. Anyone know of a way to make a copy
of a toolbar so that I can modify it and use a slightly different
version with another form?
I have seen that exact behavior. I just gave up on copying command bars and
just build each one separately. I have not seen the behavior copying an item on
a command bar to the same command bar and then changing something about the
copy, but when copying across command bars it definitely does what you describe
(although not 100% of the time).

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com




Reply With Quote
  #3  
Old   
Neil
 
Posts: n/a

Default Re: Does anyone understand toolbars? - 11-10-2007 , 09:04 AM



Interesting was that I could change the *name* of the top-level item in the
command bar copy without the name changing in the original; but if I added
or removed items under the top-level, it was reflected on both command bars.

I thought I was going to be real clever and try something else. Since it's
the last two top-level items that I need to modify, I went into the command
bar copy, created two new top-level items, and then ctrl-dragged the items
from the originals to the copies of the top-level items. This way, I didn't
delete items within the menu, but just created two new menus on the bar. The
two new menus didn't appear in the original. I then deleted the two menus
that I had copied from the menu bar, and I thought I was home-free: the
original had the two menus, and the copy had two brand new menus. Only one
problem: the original menu bar with the two menus I had copied had no items
under them! Sigh.

So I give up too. Good to know I'm not just missing something here.

Thanks,

Neil


"Rick Brandt" <rickbrandt2 (AT) hotmail (DOT) com> wrote

Quote:
Neil wrote:
So, I tried to copy a toolbar. I have a custom menu bar for a form.
Tried to copy it so that I could modify the copy and use it with
another form. With no direct way to copy it, I made a copy of the
MDB, renamed the toolbar, and then imported it back into the original
MDB as a copy of the original (see "Copying a custom menu bar" thread
here). Everything seemed fine until I tried to modify the copy. When
I added or removed items from the menu bar, the original was modified
as well! They were one toolbar with two instances in the db.

So I'm back to where I started. Anyone know of a way to make a copy
of a toolbar so that I can modify it and use a slightly different
version with another form?

I have seen that exact behavior. I just gave up on copying command bars
and just build each one separately. I have not seen the behavior copying
an item on a command bar to the same command bar and then changing
something about the copy, but when copying across command bars it
definitely does what you describe (although not 100% of the time).

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com




Reply With Quote
  #4  
Old   
Arvin Meyer [MVP]
 
Posts: n/a

Default Re: Does anyone understand toolbars? - 11-10-2007 , 09:07 AM



Can you not make a copy of the database. Delete all the unused objects in
the copy and use that as a basis for your new database? You should be able
to rename and alter the copy in that manner. Doing whatever you wish to the
"new" toolbar, then import the objects from the old database, including the
old toolbar.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Neil" <nospam (AT) nospam (DOT) net> wrote

Quote:
So, I tried to copy a toolbar. I have a custom menu bar for a form. Tried
to copy it so that I could modify the copy and use it with another form.
With no direct way to copy it, I made a copy of the MDB, renamed the
toolbar, and then imported it back into the original MDB as a copy of the
original (see "Copying a custom menu bar" thread here). Everything seemed
fine until I tried to modify the copy. When I added or removed items from
the menu bar, the original was modified as well! They were one toolbar
with two instances in the db.

So I'm back to where I started. Anyone know of a way to make a copy of a
toolbar so that I can modify it and use a slightly different version with
another form?




Reply With Quote
  #5  
Old   
lyle
 
Posts: n/a

Default Re: Does anyone understand toolbars? - 11-10-2007 , 09:13 AM



On Nov 10, 7:25 am, "Neil" <nos... (AT) nospam (DOT) net> wrote:
Quote:
So, I tried to copy a toolbar. I have a custom menu bar for a form. Tried to
copy it so that I could modify the copy and use it with another form. With
no direct way to copy it, I made a copy of the MDB, renamed the toolbar, and
then imported it back into the original MDB as a copy of the original (see
"Copying a custom menu bar" thread here). Everything seemed fine until I
tried to modify the copy. When I added or removed items from the menu bar,
the original was modified as well! They were one toolbar with two instances
in the db.

So I'm back to where I started. Anyone know of a way to make a copy of a
toolbar so that I can modify it and use a slightly different version with
another form?
A Hack:

I create a command bar "Employee Attendance Entries".
I store a copy in CommandBarsHolder.mdb
To create a copy I run a hack:

Public Sub AirCodeInHackersVille()
With Application
.CommandBars("Employee Attendance Entries").Name = "Whatever"
With WizHook
.Key = 51488399
.WizCopyCmdbars "CommandBarsHolder.mdb"
End With
.CommandBars("Employee Attendance Entries").Name = "Employee
Attendance Entries" & Format(Now(), "yyyymmddhhnnss")
.CommandBars("Whatever").Name = "Employee Attendance Entries"
End With
End Sub

Now I have the orignal plus a copy named Employee Attendance Entries
plus a date-time string.
Will changes in one result in changes to another? I don't know but I
doubt it.
Is the code polished? Nope! Clearly it needs a bunch of error-handling
thing-mes.

Is this any use to anyone? I doubt it, but, of course, every tiny
thing we learn may come in handy at some crucial time down the road
and it's fun messing!
The home db in this case is 2007; the bar holder is 1997. That's quite
a jump.



Reply With Quote
  #6  
Old   
Neil
 
Posts: n/a

Default Re: Does anyone understand toolbars? - 11-10-2007 , 05:20 PM



No, that's exactly what I did -- except I didn't delete unused objects. I
simply made a copy of the MDB, renamed the toolbar, and then imported all
toolbars. Since the other toolbars had the same name as their original
counterparts, they didn't import. The only thing that imported was the one
that I renamed in the copy.

So, I thought everything was fine, as I had two toolbars with two different
names -- one for one form, and one for another form. The problem arose when
I started modifying the copy. When I modified the copy that I had imported,
the original was modified as well.

Two toolbars in the database, two different names; yet somehow Access sees
them as the same toolbar.


"Arvin Meyer [MVP]" <a@m.com> wrote

Quote:
Can you not make a copy of the database. Delete all the unused objects in
the copy and use that as a basis for your new database? You should be able
to rename and alter the copy in that manner. Doing whatever you wish to
the "new" toolbar, then import the objects from the old database,
including the old toolbar.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Neil" <nospam (AT) nospam (DOT) net> wrote in message
news:frhZi.4926$yV6.4292 (AT) newssvr25 (DOT) news.prodigy.net...
So, I tried to copy a toolbar. I have a custom menu bar for a form. Tried
to copy it so that I could modify the copy and use it with another form.
With no direct way to copy it, I made a copy of the MDB, renamed the
toolbar, and then imported it back into the original MDB as a copy of the
original (see "Copying a custom menu bar" thread here). Everything seemed
fine until I tried to modify the copy. When I added or removed items from
the menu bar, the original was modified as well! They were one toolbar
with two instances in the db.

So I'm back to where I started. Anyone know of a way to make a copy of a
toolbar so that I can modify it and use a slightly different version with
another form?






Reply With Quote
  #7  
Old   
Wayne Gillespie
 
Posts: n/a

Default Re: Does anyone understand toolbars? - 11-10-2007 , 07:18 PM



On Sat, 10 Nov 2007 22:20:24 GMT, "Neil" <nospam (AT) nospam (DOT) net> wrote:

Rather than making a copy of your database I would try creating a new blank
database and import only the toolbars from your database and no other objects.
So you now have a database containing nothing but toolbars. Delete the toolbars
you don't want, rename your target TB. Edit the TB as required and then import
it back to your database.

This might break whatever link is syncing the toolbars in the background. Don't
know if it will work but it would be worth a try.

Quote:
No, that's exactly what I did -- except I didn't delete unused objects. I
simply made a copy of the MDB, renamed the toolbar, and then imported all
toolbars. Since the other toolbars had the same name as their original
counterparts, they didn't import. The only thing that imported was the one
that I renamed in the copy.

So, I thought everything was fine, as I had two toolbars with two different
names -- one for one form, and one for another form. The problem arose when
I started modifying the copy. When I modified the copy that I had imported,
the original was modified as well.

Two toolbars in the database, two different names; yet somehow Access sees
them as the same toolbar.


"Arvin Meyer [MVP]" <a@m.com> wrote in message
news:uFdZ7L6IIHA.4808 (AT) TK2MSFTNGP05 (DOT) phx.gbl...
Can you not make a copy of the database. Delete all the unused objects in
the copy and use that as a basis for your new database? You should be able
to rename and alter the copy in that manner. Doing whatever you wish to
the "new" toolbar, then import the objects from the old database,
including the old toolbar.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Neil" <nospam (AT) nospam (DOT) net> wrote in message
news:frhZi.4926$yV6.4292 (AT) newssvr25 (DOT) news.prodigy.net...
So, I tried to copy a toolbar. I have a custom menu bar for a form. Tried
to copy it so that I could modify the copy and use it with another form.
With no direct way to copy it, I made a copy of the MDB, renamed the
toolbar, and then imported it back into the original MDB as a copy of the
original (see "Copying a custom menu bar" thread here). Everything seemed
fine until I tried to modify the copy. When I added or removed items from
the menu bar, the original was modified as well! They were one toolbar
with two instances in the db.

So I'm back to where I started. Anyone know of a way to make a copy of a
toolbar so that I can modify it and use a slightly different version with
another form?




Wayne Gillespie
Gosford NSW Australia


Reply With Quote
  #8  
Old   
Larry Linson
 
Posts: n/a

Default Re: Does anyone understand toolbars? - 11-11-2007 , 04:58 PM



Given the number of questions about toolbars that we see here, there clearly
are quite a number of people who do NOT understand them. But you see to have
found a couple of "anyones" who certainly DO understand Toolbars.

Larry Linson



Reply With Quote
  #9  
Old   
Neil
 
Posts: n/a

Default Re: Does anyone understand toolbars? - 11-12-2007 , 02:46 AM



Indeed.

"Larry Linson" <bouncer (AT) localhost (DOT) not> wrote

Quote:
Given the number of questions about toolbars that we see here, there
clearly are quite a number of people who do NOT understand them. But you
see to have found a couple of "anyones" who certainly DO understand
Toolbars.

Larry Linson





Reply With Quote
  #10  
Old   
Neil
 
Posts: n/a

Default Re: Does anyone understand toolbars? - 11-12-2007 , 02:57 AM



Hi, Lyle. Thanks for this!

I created these objects below with the same names you used in your code, and
I ran your code. On the line:

..WizCopyCmdbars "CommandBarsHolder.mdb"

I get the error: "Object doesn't support this property or method."

Any ideas?

Thanks!

Neil


"lyle" <lyle.fairfield (AT) gmail (DOT) com> wrote

Quote:
On Nov 10, 7:25 am, "Neil" <nos... (AT) nospam (DOT) net> wrote:
So, I tried to copy a toolbar. I have a custom menu bar for a form. Tried
to
copy it so that I could modify the copy and use it with another form.
With
no direct way to copy it, I made a copy of the MDB, renamed the toolbar,
and
then imported it back into the original MDB as a copy of the original
(see
"Copying a custom menu bar" thread here). Everything seemed fine until I
tried to modify the copy. When I added or removed items from the menu
bar,
the original was modified as well! They were one toolbar with two
instances
in the db.

So I'm back to where I started. Anyone know of a way to make a copy of a
toolbar so that I can modify it and use a slightly different version with
another form?

A Hack:

I create a command bar "Employee Attendance Entries".
I store a copy in CommandBarsHolder.mdb
To create a copy I run a hack:

Public Sub AirCodeInHackersVille()
With Application
.CommandBars("Employee Attendance Entries").Name = "Whatever"
With WizHook
.Key = 51488399
.WizCopyCmdbars "CommandBarsHolder.mdb"
End With
.CommandBars("Employee Attendance Entries").Name = "Employee
Attendance Entries" & Format(Now(), "yyyymmddhhnnss")
.CommandBars("Whatever").Name = "Employee Attendance Entries"
End With
End Sub

Now I have the orignal plus a copy named Employee Attendance Entries
plus a date-time string.
Will changes in one result in changes to another? I don't know but I
doubt it.
Is the code polished? Nope! Clearly it needs a bunch of error-handling
thing-mes.

Is this any use to anyone? I doubt it, but, of course, every tiny
thing we learn may come in handy at some crucial time down the road
and it's fun messing!
The home db in this case is 2007; the bar holder is 1997. That's quite
a jump.




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.