I have another brief question. So I am trying to protect one form on my database from being accessed by people who don't need to edit the data. I found VBA code that essentially password protects the data (it compares an input string to a hardcoded string). The code (posted below) is put into the 'On Load Event' of the sensitive form.
It works fine when I am testing it in the database. However when I compile it to a .accde executable, it does not give the pop up window and challenge for a password. It simply allows access to the sensitive form.
I know that Access usually compiles the code and then deletes the source code, but is that what is causing the problem? Let me know if any of you have an ideas.
Thanks,
Tom
Code for thought:
It works fine when I am testing it in the database. However when I compile it to a .accde executable, it does not give the pop up window and challenge for a password. It simply allows access to the sensitive form.
I know that Access usually compiles the code and then deletes the source code, but is that what is causing the problem? Let me know if any of you have an ideas.
Thanks,
Tom
Code for thought:
Code:
Dim Password As String Password = InputBox("Enter Administrator Password") If Password = "mypasscode" Then ' Open Form DoCmd.OpenForm "AdminPage" DoCmd.GoToRecord , , acNewRec Else MsgBox ("You're not authorized to access this page.") DoCmd.Close End If
Comment