I closed my database and open a NEW blank database and created one form. I attached the code to a new module. I get the same error. Does that eliminate the corrupt database possibility? It is a very large database.
I closed my database and open a NEW blank database and created one form. I attached the code to a new module. I get the same error. Does that eliminate the corrupt database possibility? It is a very large database.
Provide that simple db. Let's see if it runs as is for me or if it also errors. Or is there another machine you can use? Maybe the Access install is the issue.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I am attaching 'RightClick' database for your analysis. My original database is very large. I created this one for your analysis. The code does not work on this one either. I appreaciate you held.
I removed the text from the form's Menu Bar property to avoid that error.
I added reference to Microsoft xx Object Library using Tools>References
I added code to call function behind a copy of the form
I executed code
I added the new object to the shortcut menu property in the copy of form.
Yes, had to add Microsoft Office 14.0 Object Library.
I know you earlier stated you had selected it but for some reason it was not selected in the posted db.
However, I get error when opening the form "Cannot find CreateSimpleShortcutMenu". Remove CreateSimpleShortcutMenu from the MenuBar property.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Ok, I must not know what it means to add Microsoft Office 14.0 Object Library. I have attached a pdf file of a picture of my existing reference library (this is my actual working database, not the little one I sent you). I went to 'TOOLS' then 'REFERENCES' and the picture is what it looks like. There must be something else that you are talking about. It does work in the one that was sent to me, but I can not duplicate it.
That looks like the right place. From the VBA editor: Tools > References. Now go down the list until you see "Microsoft Office 14.0 Object Library" - that EXACT wording.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
If you look at the attachment ( on my previous post), it show that there is a check mark by 'Microsoft Office 14.0 Object Library'. But both of you said I do not have a reference to. What do I need to do?
In the DB you uploaded there is not a reference. There are two issues with the DB you uploaded. The first issue was getting the form to load. Fix that by clearing the MenuBar property, see post #20. The other error associated with the DB you uploaded is that it does not have a reference to the Object Library, see post #19.
Address those two issues and then include a line of code to call the function to fix the DB you uploaded. Then you can compare the working "example DB" with your "production DB".
Please see the attachment. It is a picture of my original db reference liabary. There is a check mark by the object 'Microsoft Office 14.0 Object Library'. Does that mean there is a reference to it?
I do not see "Microsoft Office 14.0 Object Library" in that image. There are "Microsoft Access ..." and "Microsoft Outlook ..." and "Microsoft Office 14.0 Access database ..."
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I am still getting the same error message. Where do I go now?
The modified database provided by ItsMe will not work for you?
From here, I suggest you test on another computer. If that works, then reinstall Access on your first computer.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Experts are already helping you out. If want this menu permanently, then change the following line in your module
toCode:Set cmbShortcutMenu = CommandBars.Add("SimpleShortcutMenu", msoBarPopup, False, True)
Then you have to never run the code again to build the menu and menu is always available unless you delete it.Code:Set cmbShortcutMenu = CommandBars.Add("SimpleShortcutMenu", msoBarPopup, False, False)
A temporary menu is deleted when the database is closed.
So you say the modified db provided by ItsMe works? Then should be able to do the same in your primary db. We can't offer any more advice without being able to analyse it ourselves.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.