Checking for valid characters

  • Thread starter Thread starter Brad
  • Start date Start date
B

Brad

Is there an easy way to take an input string and check for valid characters?
For instance, I am working on an expense report in where the cells have to
have numeric data only. So if the user accidentally inputs a space
somewhere in the data string, the program will error and alert the user to
this fact.

Thanks for the information.

Brad
 
Brad said:
Is there an easy way to take an input string and check for valid characters?
For instance, I am working on an expense report in where the cells have to
have numeric data only. So if the user accidentally inputs a space
somewhere in the data string, the program will error and alert the user to
this fact.


Perhaps something like:

If strUserText Like "*[!0-9]*" Then
' Bad input
Else
' Good input
End If

LFS
 
Larry,

Thanks for the information. VB .Net has been a "learn as I go" process.

Brad

Larry Serflaten said:
Brad said:
Is there an easy way to take an input string and check for valid characters?
For instance, I am working on an expense report in where the cells have to
have numeric data only. So if the user accidentally inputs a space
somewhere in the data string, the program will error and alert the user to
this fact.


Perhaps something like:

If strUserText Like "*[!0-9]*" Then
' Bad input
Else
' Good input
End If

LFS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top