UKBobby
Fly Me To The Moon
- Local time
- Today, 07:02
- Joined
- Dec 31, 2002
- Messages
- 23
Hi
I'm new to this board but though I'd ask you good people for a bit of help. I've inherited some code which validates a password held on a table with data from a form. The code works but I can't get it to refresh the data. I.E. if I put correct userid and password it works fine but if I put an incorrect one in then a correct one in it tells me its incorrect. If you see what I mean
Anyway here's the code:
Private Sub Password_AfterUpdate()
DoCmd.OpenForm "025Frm_PasswordVer", , , "[Wage_no]= Forms![025Frm_Password]![User_id]", , acHidden
If IsNull(Forms![025Frm_PasswordVer]![wage_no]) Then
MsgBox "Wage Number is Invalid"
Forms![025Frm_Password]![User_id] = Null
Forms![025Frm_Password]![Password] = Null
Me![User_id].SetFocus
ElseIf Forms![025Frm_PasswordVer]![Password] <> Forms![025Frm_Password]![Password] Then
MsgBox "Incorrect Password Entered"
Forms![025Frm_Password]![User_id] = Null
Forms![025Frm_Password]![Password] = Null
Me![User_id].SetFocus
Else: DoCmd.Close
DoCmd.OpenForm "MainMenu"
End If
End Sub
Any help would be greatly appreciated
I'm new to this board but though I'd ask you good people for a bit of help. I've inherited some code which validates a password held on a table with data from a form. The code works but I can't get it to refresh the data. I.E. if I put correct userid and password it works fine but if I put an incorrect one in then a correct one in it tells me its incorrect. If you see what I mean
Anyway here's the code:
Private Sub Password_AfterUpdate()
DoCmd.OpenForm "025Frm_PasswordVer", , , "[Wage_no]= Forms![025Frm_Password]![User_id]", , acHidden
If IsNull(Forms![025Frm_PasswordVer]![wage_no]) Then
MsgBox "Wage Number is Invalid"
Forms![025Frm_Password]![User_id] = Null
Forms![025Frm_Password]![Password] = Null
Me![User_id].SetFocus
ElseIf Forms![025Frm_PasswordVer]![Password] <> Forms![025Frm_Password]![Password] Then
MsgBox "Incorrect Password Entered"
Forms![025Frm_Password]![User_id] = Null
Forms![025Frm_Password]![Password] = Null
Me![User_id].SetFocus
Else: DoCmd.Close
DoCmd.OpenForm "MainMenu"
End If
End Sub
Any help would be greatly appreciated