Hi,
I'm pretty new to vb 2005 and finding things that were straight forward in VB6 are difficult to fathom in vb 2005. One such thing is validation of form fields. I have a field where the validation takes place in the validating event but I want the form Cancel button to ignore all vailidation and exit the form. I have put 'Me.cmdCancel.CausesValidation = False' in the form Load event but this does not seem to work. The validation code is:
Private Sub txtTitle_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtTitle.Validating
If (IsNothing(Me.txtTitle.Text)) Or (Me.txtTitle.Text = "") Then
MsgBox("Enter a valid Pin Board item Title", MsgBoxStyle.Exclamation)
Me.txtTitle.Focus()
Exit Sub
End If
End Sub
I would be grateful for any help. Many thanks.
I'm pretty new to vb 2005 and finding things that were straight forward in VB6 are difficult to fathom in vb 2005. One such thing is validation of form fields. I have a field where the validation takes place in the validating event but I want the form Cancel button to ignore all vailidation and exit the form. I have put 'Me.cmdCancel.CausesValidation = False' in the form Load event but this does not seem to work. The validation code is:
Private Sub txtTitle_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtTitle.Validating
If (IsNothing(Me.txtTitle.Text)) Or (Me.txtTitle.Text = "") Then
MsgBox("Enter a valid Pin Board item Title", MsgBoxStyle.Exclamation)
Me.txtTitle.Focus()
Exit Sub
End If
End Sub
I would be grateful for any help. Many thanks.