I have 4 textboxes, and I am trying to validate that at least one of the textboxes is filled before they hit search to check their search criteria.
My Problem: My code is working, but when I want to continue with one filled field, it still shows the messageBox.
If txtMember.Text = "" Then
MessageBox.Show("Please enter a value!")
ElseIf txtReference.Text = "" Then
MessageBox.Show("Please enter a value!")
ElseIf txtName.Text = "" Then
MessageBox.Show("Please enter a value!")
ElseIf txtCode.TextLength = "" Then
MessageBox.Show("Please enter a value!")
Else
SearchClick()
End If
How do I fix this? Your help would be much appreciated.