Hello all!!
I have a database in which the user should enter a password to move from one form to other. Here is the code which prompts for a password. I wish to give the user an option to change the password. I made a password table with one column in which the password will be stored. Would anyone suggest me how to alter the following code. i.e How to retrieve the password from the Password table into this? Right now, the password is static(Shown in the code). The access version is 2000. Passbut is the button, when clicked gives a password prompt. "Medical" is the form to which Password protection is given.
Any help/code would be greatly appreciated.
P.S. I don't have the docmd.database option here.
Thanks
pkn
Private Sub PassBut_Click()
On Error GoTo Err_PassBut_Click
Dim stDocName As String
Dim stLinkCriteria As String
If InputBox("Enter Password to view medical information", "Enter Your Password" = "usa" Then
stDocName = "Medical"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Maximize
End If
Exit_PassBut_Click:
Exit Sub
Err_PassBut_Click:
MsgBox Err.Description
Resume Exit_PassBut_Click
End Sub
I have a database in which the user should enter a password to move from one form to other. Here is the code which prompts for a password. I wish to give the user an option to change the password. I made a password table with one column in which the password will be stored. Would anyone suggest me how to alter the following code. i.e How to retrieve the password from the Password table into this? Right now, the password is static(Shown in the code). The access version is 2000. Passbut is the button, when clicked gives a password prompt. "Medical" is the form to which Password protection is given.
Any help/code would be greatly appreciated.
P.S. I don't have the docmd.database option here.
Thanks
pkn
Private Sub PassBut_Click()
On Error GoTo Err_PassBut_Click
Dim stDocName As String
Dim stLinkCriteria As String
If InputBox("Enter Password to view medical information", "Enter Your Password" = "usa" Then
stDocName = "Medical"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Maximize
End If
Exit_PassBut_Click:
Exit Sub
Err_PassBut_Click:
MsgBox Err.Description
Resume Exit_PassBut_Click
End Sub