A
Andy
Hi;
Have created frmPasswordEnter. This frmPasswordEnter opens the first time a
User enters the DBase. It is triggered by an If/Then function in the
"AutoExec" macro.
Public Function PasswordPrompt()
Dim strInput As String, strMsg As String
strMsg = "Enter your Password."
strInput = InputBox(Prompt:=strMsg,
If(isnull((DLookup("[Password]", "tblMainTbl") then
DoCmd.OpenForm "frmPasswordEnter"
Else
If strInput Like (DLookup("[Password]", "tblMainTbl")) Then
DoCmd.OpenForm "frmMainData"
Else
MsgBox "That is not the correct password. Please enter the correct
password."
End If
This all works fine up to a point.
First need to "Mask" the Input password.
E.G.: Instead of "MyPassword" it should show **********
Second how do You get the Inputbox to prompt 3 times.
E.G.: InputBox WrongPassword then InputBox WrongPassword then InputBox
WrongPassword then MSGBOX "Dbase is Closing"
Have read Microsoft's Supports including "209871 How to Create a Password
Protected Form or Report" but that requires a separate form with it's own
module and the code is long and cumbersome.
Believe the approach described above is a lot simpler and it doesn't take up
as much "Real Estate" as Microsoft's solution.
Would someone be so kind as to point me in the correct direction?
Thank You for reading this post.
Andy
Have created frmPasswordEnter. This frmPasswordEnter opens the first time a
User enters the DBase. It is triggered by an If/Then function in the
"AutoExec" macro.
Public Function PasswordPrompt()
Dim strInput As String, strMsg As String
strMsg = "Enter your Password."
strInput = InputBox(Prompt:=strMsg,
If(isnull((DLookup("[Password]", "tblMainTbl") then
DoCmd.OpenForm "frmPasswordEnter"
Else
If strInput Like (DLookup("[Password]", "tblMainTbl")) Then
DoCmd.OpenForm "frmMainData"
Else
MsgBox "That is not the correct password. Please enter the correct
password."
End If
This all works fine up to a point.
First need to "Mask" the Input password.
E.G.: Instead of "MyPassword" it should show **********
Second how do You get the Inputbox to prompt 3 times.
E.G.: InputBox WrongPassword then InputBox WrongPassword then InputBox
WrongPassword then MSGBOX "Dbase is Closing"
Have read Microsoft's Supports including "209871 How to Create a Password
Protected Form or Report" but that requires a separate form with it's own
module and the code is long and cumbersome.
Believe the approach described above is a lot simpler and it doesn't take up
as much "Real Estate" as Microsoft's solution.
Would someone be so kind as to point me in the correct direction?
Thank You for reading this post.
Andy