I am trying to validate input in this VB program that calculates football stats. If both boxes are empty when a user clicks Update Stats, it should display a message box. However, with this code it shows the message whether both boxes are empty or if they have values entered. Any idea what I am doing wrong? I can post the entire code if need be. I can't think of anything. I've tried string.empty, string.IsNullOrWhiteSpace, .length < 0, so I am not sure what's going on.
Code:
' validate user input (ensure textBoxes aren't blank)
If passYdTextBox.Text = "" And rushYdTextBox.Text = "" Then
MessageBox.Show("Please enter values into pass yards box or rush yards box")
End If