Beyond setting the
CausesValidation
property of the exit button to false, also set the DialogResult of the form in the function handling the click event of the exit button before you call Close, e.g.
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
DialogResult = Windows.Forms.DialogResult.Cancel
Close()
End Sub
Then test for a DialogResult in your validation code
Private Sub TxtVnum_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TxtVnum.Validating
If Me.DialogResult = Windows.Forms.DialogResult.None Then
If TxtVnum.Text = "" Then
MsgBox("Enter Receipt Number")
TxtVnum.Focus()
Exit Sub
End If
End If
End Sub