Hi all
I have been struggling since morning to run a vb code that enables users to change their password. I have a sample table and one form to test the functionality but nothing is happening.
table name:tbluser_details
fields
User_password;text
intUserID;numeric
the code is as follows
Private Sub Command13_Click()
Dim intUserID As Integer
Dim strOldPassword As String
Dim strSQL As String
intUserID = Me.List0
strOldPassword = DLookup("[User_password]", "tbluser_details", "[User_id]=" & intUserID.Value)
Select Case strOldPassword
Case Is = Me.txtOldPassword
Me.txtNewPass.SetFocus
strSQL = "UPDATE tbluser_details SET User_password=" & "'" & Me.txtNewPass.Text & "'" & " " & "WHERE [User_id]=" & "'" & Me.Combo17 & "';"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
MsgBox "Password has been changed", vbInformation, "Password Changed"
Case Is <> Me.txtOldPassword
MsgBox "The Old Password doesnot match", vbInformation, "Type Correct Old Password"
Me.txtOldPassword = ""
End Select
please help urgently