Hi!
I've got the following problem. I have a form on which users can change their password. On this form there a submit button with the following code:
*********************
Private Sub cmdSubmit_Click()
Dim UpdatePW As New MyTestClass3
If Me.filledCheck = False Then
MsgBox "Please complete all entries before " & _
"submitting your new password.", vbInformation, _
"Warning"
ElseIf txtPassword <> txtConfirm Then
MsgBox "Password and Confirm Password do not " & _
"match. Re-enter one or both.", vbInformation, _
"Warning"
Else
UpdatePW.NewPW txtEmpID, txtPassword
End If
End Sub
*********************
Then there is a module, MyTestClass3. The code is:
*********************
Sub NewPW(txtEmpID As String, txtPassword As String)
Dim cmd1 As Command
Dim strSQL As String
'Assign the command reference and connection.
Set cmd1 = New ADODB.Command
cmd1.ActiveConnection = CurrentProject.Connection
'Define the SQL string; notice
'the insertion of passed arguments.
strSQL = "UPDATE gebruikers " & _
"SET gebruikers.password = """ & txtPassword & """ " & _
"WHERE user_id=" & txtEmpID & ";"
Debug.Print strSQL
'Assign the SQL string to the command and run it.
cmd1.CommandText = strSQL
cmd1.CommandType = adCmdText
cmd1.Execute
'Confirmation message
MsgBox "Your new password is accepted. " & _
"Return to Employee Authentication or " & _
"Exit this form.", vbInformation, _
"Affirmative"
End Sub
*********************
When I click on the submit button there comes a messagebox which says I didnt specify enough paramters :-S
I can't seem to figure out what is going wrong...can anyone help with this? I think it has to do with declaring txtEmpID as string, but I am not quite sure.
Thnx in advance,
Thijs Kromhout
I've got the following problem. I have a form on which users can change their password. On this form there a submit button with the following code:
*********************
Private Sub cmdSubmit_Click()
Dim UpdatePW As New MyTestClass3
If Me.filledCheck = False Then
MsgBox "Please complete all entries before " & _
"submitting your new password.", vbInformation, _
"Warning"
ElseIf txtPassword <> txtConfirm Then
MsgBox "Password and Confirm Password do not " & _
"match. Re-enter one or both.", vbInformation, _
"Warning"
Else
UpdatePW.NewPW txtEmpID, txtPassword
End If
End Sub
*********************
Then there is a module, MyTestClass3. The code is:
*********************
Sub NewPW(txtEmpID As String, txtPassword As String)
Dim cmd1 As Command
Dim strSQL As String
'Assign the command reference and connection.
Set cmd1 = New ADODB.Command
cmd1.ActiveConnection = CurrentProject.Connection
'Define the SQL string; notice
'the insertion of passed arguments.
strSQL = "UPDATE gebruikers " & _
"SET gebruikers.password = """ & txtPassword & """ " & _
"WHERE user_id=" & txtEmpID & ";"
Debug.Print strSQL
'Assign the SQL string to the command and run it.
cmd1.CommandText = strSQL
cmd1.CommandType = adCmdText
cmd1.Execute
'Confirmation message
MsgBox "Your new password is accepted. " & _
"Return to Employee Authentication or " & _
"Exit this form.", vbInformation, _
"Affirmative"
End Sub
*********************
When I click on the submit button there comes a messagebox which says I didnt specify enough paramters :-S
I can't seem to figure out what is going wrong...can anyone help with this? I think it has to do with declaring txtEmpID as string, but I am not quite sure.
Thnx in advance,
Thijs Kromhout