Right click shortcut menu code locks shared database every time

Viewed 32

I have a compiled Access database with a front-end (where this code is running) and compiled back end data storage.

I have code to create a shortcut menu, if inserted into the start-up routine of the database, MS Access ignores the default setting to open as shared mode on the Access database, and opens as Exclusive mode. This is causing a lot of problems.

Public Sub sbCreateReportShortCutMenu()

Dim cmbRightClick as Office.CommandBar

Set cmbRightClick =  CommandBars.Add("cmdFormRightClick", 0,, True)
Set cmbRightClick = Nothing

End Sub

Moving the code so it only runs when needed (before opening forms in this case), the issue still occurs. If the first user in the database opens a form which requires this code, and nobody else is in the database at the time, the database goes in to exclusive mode and other people can't access it.

All PCs/people accessing the database front end have Access set to shared/no locks as default.

What is it about this code causing the shared database to lock? Any ideas please? Thank you in advance

1 Answers
Related