I need to test to see if case numbers exist in the database or not. This is what I have so far:

VB Code:
  1. If IsNumeric(txtSearchCase.Text.Substring(0)) Then
  2.             cmdSqlCommand1.CommandText = "SELECT * FROM tblCapRec WHERE CaseNumber LIKE '" & txtSearchCase.Text & "%' ORDER BY CaseNumber, PartNumber, LastName, FirstName"

It works fine if the case is found in the database, but if it's not it gives me an error. How do I test to see if it exists or not?

Thanks!

Brenda