INFO: Known Bug, Dropping Shortcut menus, 2000/XP maybe 2003?

  • Thread starter Thread starter Tony Vrolyk
  • Start date Start date
T

Tony Vrolyk

I have recently ran into a problem which after contacting MS support, found
that it is a known bug for which there is no fix. It relates to shortcut
menus being dropped after modifying them from code twice and then closing a
db.

I wasn't sure where best to post, but since Forms is a heavily used group,
and shortcut menus are used on forms, this seemed the logical place.

I am creating an app that heavily depends on the shortcut menus I have
created, and I soon saw them disappearing for no apparent reason. I tried
all the usual stuff, decompile, compile, compact, import to new db. I also
tried renaming the menus removing the underscores I had used. Also tried
renaming removing potential reserved words, nothing helped. Contacted Tech
support figuring I would have to use one of the support incidents that came
with my XP Dev license.

As it turned out the issue was a known issue and I didn't have to use one
of my free incidents. Below is the final summary from the support person I
worked with on my case. Also at the end of the post is a method to reproduce
the error. You can use this to test your installation. It attempts to
recreate the problem and from what I understand that if it cannot be
recreated once, then you do not have the bug. However there is nothing
indicating it can't arise later depending on circumstances. Also he had
no info about whether or not there was a planned fix or if there will be an
SP4 which would include the fix.

Lastly, the support person I dealt with could not determine if there was a
known pattern as to what OS, Access version and patch level the issue
effected except that is does not effect a Runtime installation. For the
record my DB was created as a 2002 version db under AC2002 dev SP3, running
on XP Pro SP1. At one point the file was converted to a 2000 version and
later back to 2002.

As indicated in the summary, here is the workaround I am using. I regularly
create a blank db into which I import one form from my app using the option
to import menus and toolbars. Then as needed I can re-import that form to my
app, again using the options to import menus and toolbars. This will
recreate my missing menu and I can go on my way.

Hope this helps anyone having the same problem I am.

Thanks
Tony Vrolyk

*********************************************
Case summary
ACTION:
Within your Microsoft Access 2002 application you are running into a
situation whereby your menu bars are being deleted within your application
as changes (programmatically) are being made to the items. This happens
sporadically.

CAUSE:
Known issue with menu bars being modified programmatically within Microsoft
Access 2000 and above

WORKAROUND:
You currently have a workaround whereby you would re import the deleted menu
bars from within another *.MDB file.

Other workaround we proposed was:
1- Say you have a menu bar (CommandBar) named "Custom 1"

2- Use the following code to see if it was deleted and if it was can
recreate it using VBA code

Dim x
Dim strBar As String

For Each x In Application.CommandBars
If x.name = "Custom 1" Then
strBar = "Custom 1"
Exit For
End If
Next x

' if no CommandBar named Custom 1, and need to run code to recreate
IF strBar = "" THEN
' use the code in the knowledge base article
' http://support.microsoft.com/?id=159692
End IF

Thank you for choosing Microsoft Access Developers Support,
Eric B....., MCSE, MCSA, MCDBA, MCSD
Microsoft Developer Support - Access

*********************************************
Steps to attempt to recreate the problem

(1) create a new blank database and call it "test"
(2) customize toolbars
(2a) add a new toolbar "cbtest"
(2b) add command "Custom" to the toolbar "cbtest"
(2c) change the property of cbtest - set type to "Popup" and skip the hint
window by pressing the OK-Button
(2d) close the "Customize" window
(3) Create a new module (and switch automatically to VB environment)
(4) Add reference "Microsoft Office 10.0 Object library"
(5) Add following code

Public Function cbtest()
Dim actrl As CommandBarButton
Set actrl = CommandBars("cbtest").Controls(1)

If actrl.Caption = "flip" Then
actrl.Caption = "flop"
Else
actrl.Caption = "flip"
endif

CommandBars("cbtest").ShowPopup

End Function

(6) save the code into module1 and close VB environment
(7) in the database "test" create a macro "Autoexec", which calls the
function cbtest by the action "RunCode cbtest()"
(8) close the database "test"
(9) open the database "test" (you see a PopUp)
(10) run the macro "autoexec" a 2nd time (the PopUp changes)
(11) close the database "test"
(12) open the database "test"
 
Tony

There is a similar bug if you make changes interactively to a custom shortcu
(popup) can be lost.

The workaround there is to chanate its type for the duration of the (manual)
change and then change it back to a popup.

Perhaps there is a similar coding solution to your dilemma?

Cheers,
 
We may be taling about the same bug. the menus I am creating are pop-up
menus and after disableing/enableing them in code they can disappear.

I assme you mean 'change' not 'chanate'. So if I understand correctly, you
suggest changing the menu type to say, menu, make whatever change I need and
then change it back to a pop-up.

Would this be any kind of serious peroformance hit? Though I am not sure I
even need to worry about it. At this point it is really just an annoyance.
The support person I spoke with indicated this is not an issue when running
under Access Runtime and that is how my app will be distributed. the problem
really only happens during development.

Thanks
tony
 
Back
Top