the user of my program is going to enter something to search for into a text box.

and depending on which option box they choose it either needs to be text or numeric data and I need to error code to prevent accidentally searching for a numeric field for a text string and so on..

i know in c++ theres a function like istext or something like this.. is there any way I can pass a check to find out what type of data the variable contains?

I appreciate any help in advance.. heres my code.

Dim strFind As String
strFind = txtFind.Text

If optRoute.Value = True Then
Adodc1.RecordSource = "SELECT * FROM DistTable WHERE RteNum = " & strFind
Adodc1.Refresh
txtFind.Text = ""
txtFind.SetFocus
Exit Sub
End If

If optLast.Value = True Then
Adodc1.RecordSource = "SELECT * FROM DistTable WHERE LName = '" & strFind & "'"
Adodc1.Refresh
txtFind.Text = ""
txtFind.SetFocus
Exit Sub
End If