C
CRC
I am trying to set a password protection for each user to log into a form.
With their login name I want it to Repaint or Copy into the Name field or
control in the form after verifying that the Name and Password matches. Can
any on Help?
I tried some of the solutions that was posted by other questioners,
Form_Current using the If Not IsNull statement.
-----------------------------------
Private Sub Form_Current()
If Not IsNull(Me.OpName) Then
MsgBox "Please login."
Me.Submit.Enabled = False
ElseIf Not IsNull(Me.PW) Then
MsgBox "Retype your password."
Me.Submit.Enabled = False
ElseIf (Me.PW = "phoenix") Then
Me.Submit.Enabled = True
End If
End Sub
-----------------------
The thing with this code it keeps running back to Please login...
Heres the one for the coomand button on_click().
------------------------------------
Private Sub Submit_Click()
On Error GoTo Submit_Click_Err
Dim Submit As CommandButton
Dim PW As String
If Me.PW = "phoenix" Then
DoCmd.Close "LoginForm6"
DoCmd.OpenForm "TS 6", acNormal, "", "", acEdit, acNormal
DoCmd.GoToRecord acForm, "TS 6", acLast
DoCmd.GoToControl "Order"
Else
MsgBox "Your Name or Password did not match." & vbLf & _
"Please check and try again. "
End If
Submit_Click_Exit:
Exit Sub
Submit_Click_Err:
MsgBox Error$
Resume Submit_Click_Exit
End Sub
With their login name I want it to Repaint or Copy into the Name field or
control in the form after verifying that the Name and Password matches. Can
any on Help?
I tried some of the solutions that was posted by other questioners,
Form_Current using the If Not IsNull statement.
-----------------------------------
Private Sub Form_Current()
If Not IsNull(Me.OpName) Then
MsgBox "Please login."
Me.Submit.Enabled = False
ElseIf Not IsNull(Me.PW) Then
MsgBox "Retype your password."
Me.Submit.Enabled = False
ElseIf (Me.PW = "phoenix") Then
Me.Submit.Enabled = True
End If
End Sub
-----------------------
The thing with this code it keeps running back to Please login...
Heres the one for the coomand button on_click().
------------------------------------
Private Sub Submit_Click()
On Error GoTo Submit_Click_Err
Dim Submit As CommandButton
Dim PW As String
If Me.PW = "phoenix" Then
DoCmd.Close "LoginForm6"
DoCmd.OpenForm "TS 6", acNormal, "", "", acEdit, acNormal
DoCmd.GoToRecord acForm, "TS 6", acLast
DoCmd.GoToControl "Order"
Else
MsgBox "Your Name or Password did not match." & vbLf & _
"Please check and try again. "
End If
Submit_Click_Exit:
Exit Sub
Submit_Click_Err:
MsgBox Error$
Resume Submit_Click_Exit
End Sub