hi all!
I have made a password protection to a form and the code is
below. i.e the form opens only when the user enters password. I also need to give change password access to the user. For that, i made a password table and I am storing password in that. Now, I would like to retrieve the password from the table and place it in the code below(instead of writing "hello" directly in the code below, is it possible to retrieve it from the table?). I;ve tried but it didn't work out. I would be thankful if you could tell me the way. Any changes made to the code would be appreciated.
Thanks
I
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" = "hello" 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 made a password protection to a form and the code is
below. i.e the form opens only when the user enters password. I also need to give change password access to the user. For that, i made a password table and I am storing password in that. Now, I would like to retrieve the password from the table and place it in the code below(instead of writing "hello" directly in the code below, is it possible to retrieve it from the table?). I;ve tried but it didn't work out. I would be thankful if you could tell me the way. Any changes made to the code would be appreciated.
Thanks
I
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" = "hello" 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