Christineeve
Programmer
I've struggled with my textbox code. I am trying to only launch a form if the textbox data has actually changed.
This doesn't work because it launches the change form even when the box is first populated by the code initated when the form loads.
Other events such as lost or gotfocus trigger for the wrong reason.
Somehow I need to capture the original value, compare it with the new value and if different, launch the form.
Would anyone have a suggestion on how to do this?
Code:
Private Sub txtLastName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtLastName.TextChanged
Try
'If the last name has changed, collect the reason.
frmReasonChange.ShowDialog()
Catch ex As Exception
End Try
End Sub
Other events such as lost or gotfocus trigger for the wrong reason.
Somehow I need to capture the original value, compare it with the new value and if different, launch the form.
Would anyone have a suggestion on how to do this?