|
-
Aug 14th, 2001, 11:11 AM
#1
Thread Starter
Member
types of data in variables?
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
-
Aug 14th, 2001, 11:16 AM
#2
If IsNumeric(text.text) then
'it is a number
Else
'A string
End If
-
Aug 14th, 2001, 11:23 AM
#3
Thread Starter
Member
tanks
thanks again.. much appreciated
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|