Here is what I have so far, it loops while the PW is incorrect, or
until cancel is selected. I want it to lock the tables for adds,
deletes, and edits when cancel is selected, and if the PW is correct.
I want this to run when the DB is opened, I would also like the text
box to be starred (*) out when text is input.
Thanks for your help.
=============== ===============
Dim Show_Box As Boolean
Dim Response As String
' Set the Show_Dialog variable to True.
Show_Box = True
InputBox
' Begin While loop.
While Show_Box = True
' Show the input box.
Response = InputBox("Enter the Password to Unlock Read-Only
Mode.", _
"Read-Only Unlocking")
' See if Cancel was pressed.
If Response = "" Then
' If Cancel was pressed,
' break out of the loop.
Show_Box = False
Else
' Test Entry to find out if it is the correct password.
If "safety" = Response = True Then
'Application.Cl oseCurrentDatab ase
'Application.DB Engine.OpenData base "P:\ACTION REGISTER
\TESTERIncidet Action Register Database.mdb", , True
'Application.Op enCurrentDataba se "P:\ACTION REGISTER
\TESTERIncidet Action Register Database.mdb", False
'Access.AcOpenD ataMode.acReadO nly
Show_Box = False
Else
' If the entry was wrong, show an error message.
MsgBox "Wrong Password, Try again."
End If
End If
' End the While loop.
Wend
=============== =============== =============== =
until cancel is selected. I want it to lock the tables for adds,
deletes, and edits when cancel is selected, and if the PW is correct.
I want this to run when the DB is opened, I would also like the text
box to be starred (*) out when text is input.
Thanks for your help.
=============== ===============
Dim Show_Box As Boolean
Dim Response As String
' Set the Show_Dialog variable to True.
Show_Box = True
InputBox
' Begin While loop.
While Show_Box = True
' Show the input box.
Response = InputBox("Enter the Password to Unlock Read-Only
Mode.", _
"Read-Only Unlocking")
' See if Cancel was pressed.
If Response = "" Then
' If Cancel was pressed,
' break out of the loop.
Show_Box = False
Else
' Test Entry to find out if it is the correct password.
If "safety" = Response = True Then
'Application.Cl oseCurrentDatab ase
'Application.DB Engine.OpenData base "P:\ACTION REGISTER
\TESTERIncidet Action Register Database.mdb", , True
'Application.Op enCurrentDataba se "P:\ACTION REGISTER
\TESTERIncidet Action Register Database.mdb", False
'Access.AcOpenD ataMode.acReadO nly
Show_Box = False
Else
' If the entry was wrong, show an error message.
MsgBox "Wrong Password, Try again."
End If
End If
' End the While loop.
Wend
=============== =============== =============== =
Comment