Sonny Thai

Sonny Thai

  • NA
  • 11
  • 0

Need help with my code!

Oct 15 2007 11:01 PM

I can't figure out how to make this work:

If CInt(txtLengthStay.Text) Or CInt(txtMedication.Text) Or CInt(txtSurgical.Text) Or CInt(txtLabFees.Text) Or CInt(txtPhysical.Text) <= "-1" Then

MessageBox.Show("Please do not enter numbers less than 0", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)

The point is if the user enters a number less than 0, a message box will pop up to let them know that only numbers 0 and up are allowed. However, everytime I run the program any number above 30, the messagebox pops up. What am I doing wrong? Thanks for the help guys!


Answers (4)