M
mike via AccessMonster.com
hi
i have a form and a subform it works fine. Now my question is i have a button
command(to edit) on my mainform. the button command will open a form to check
a password to enter. i wanted to enable a certain field from my mainform if
only if the password entered by user is correct and if not i want my fields
as it is.
(code of my edit button)
Private Sub Edit_Click()
On Error GoTo Err_edit_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmpassedit"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Me.MC_Req_.SetFocus
Exit_edit_Click:
Exit Sub
Err_edit_Click:
Err.Description
Resume Exit_edit_Click
End Sub
(code of my password form)
Private Sub checkpaassword_Click()
If IsNull(Forms!frmpassedit!Text0.Value) Then
MsgBox "It is not a blank Password...Try again."
Me!Text0.SetFocus
End If
If (Forms!frmpassedit!Text0 <> "vincent") Then
MsgBox "Wrong Password...Try again."
Me!Text0.SetFocus
End If
If (Forms!frmpassedit!Text0 = "vincent") Then
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAncReq"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, Me.NAME
End If
End Sub
Private Sub Command4_Click()
DoCmd.Close acForm, "frmpassEdit"
End Sub
i want to enable the field on main form only if the password is correct:
thanks for any help
i have a form and a subform it works fine. Now my question is i have a button
command(to edit) on my mainform. the button command will open a form to check
a password to enter. i wanted to enable a certain field from my mainform if
only if the password entered by user is correct and if not i want my fields
as it is.
(code of my edit button)
Private Sub Edit_Click()
On Error GoTo Err_edit_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmpassedit"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Me.MC_Req_.SetFocus
Exit_edit_Click:
Exit Sub
Err_edit_Click:
Err.Description
Resume Exit_edit_Click
End Sub
(code of my password form)
Private Sub checkpaassword_Click()
If IsNull(Forms!frmpassedit!Text0.Value) Then
MsgBox "It is not a blank Password...Try again."
Me!Text0.SetFocus
End If
If (Forms!frmpassedit!Text0 <> "vincent") Then
MsgBox "Wrong Password...Try again."
Me!Text0.SetFocus
End If
If (Forms!frmpassedit!Text0 = "vincent") Then
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAncReq"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, Me.NAME
End If
End Sub
Private Sub Command4_Click()
DoCmd.Close acForm, "frmpassEdit"
End Sub
i want to enable the field on main form only if the password is correct:
thanks for any help