Aaahh, after extensive searches on Bing trying to learn more about database properties and getting nowhere, I see how your code works and what might be wrong with my database. There is no visible place that I could find to set the property "AllowByPassKey". Somehow is must be getting turned off, because I see after I run your code, I can close and reopen the database with the shift key down and it works. Something happens when I close the application using the Quit button to set it back to false.
and I found out what it was.
Code:
Public Function SetStartOption()
If GetFacCode() = "720" Then
Call SetStartUpOptions("AllowBypassKey", dbBoolean, True)
Else: Call SetStartUpOptions("AllowBypassKey", dbBoolean, False)
End If
End Function
This explains why when I use "720" as a FacCode, this does not happen. I never quite understood what this was doing until now. Mystery solved!
Thank you for your assistance.
Paul