Hi Ridders
sorry i really forgot. small thing
Code:
Private Sub Command7_Click()Dim StrSQL As String
Dim rec As String
Dim but As String
Dim Ic As String
Ic = DLookup("[QuestionAnswer]", "tblUser", "[ID] = " & Me.UserLogin)
If IsNull(Me.Text10) Then
MsgBox "Answer Cannot Be Empty"
Me.Text10.SetFocus
ElseIf IsNull(Me.Text4) Then
MsgBox "Password Cannot Be Empty"
Me.Text4.SetFocus
ElseIf DCount("*", "tblUser", "[UserPassword]= '" & Me.Text4 & "'") Then '> 0 Then
MsgBox "Please set a new password. OLD PASSWORD CANNOT BE REUSED !!! "
ElseIf (Text10.Value = Ic) Then
'ElseIf (Text10.Value <> Ic) Then
'MsgBox "Your answer could not be verified, please try again. If Not Please Contact The Administrator "
'Else
StrSQL = "INSERT INTO tblUser (UserPassword) " & "VALUES ('" & Me.Text4 & "')"
'DoCmd.RunCommand acCmdSaveRecord
'CurrentDb.Execute "Update tblUser SET Pdate = Date() WHERE ID = " & Me.UserLogin
MsgBox " Password Of " & Me.Text2 & " Updated Successfully !!!"
rec = Me.Text2
but = "Password Update"
CurrentDb.Execute "INSERT INTO ActivityLog (User, Form_Name, Record_ID,Record_Name,Activity_Date,Activity_Time)" & " VALUES ('" & rec & "','" & but & "','" & Me.UserLogin & "','" & Me.Text2 & "',Now(),Now())"
DoCmd.Close
DoCmd.OpenForm "Login"
Else
MsgBox "Your answer you provided could not be verified, please try again. If Not Please Contact The Administrator "
End If
End Sub
above is the button click method im using. is there is way to call below method inside above code instead of calling inside beforeupdate event.