Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > determining if textbox contains numeric or alphabetic characters


Reply
 
Thread Tools Display Modes
  #1  
Old 05-11-2004, 08:23 AM
irishgirlbrid irishgirlbrid is offline
Newcomer
 
Join Date: May 2004
Posts: 5
Default determining if textbox contains numeric or alphabetic characters


hi,

I'm using vb and need to test the contents of a text box to determine if the characters in it are numbers or characters.

for example if my textbox contained "apiuhdiu" I need to ignore it, but if it contained "152.235", I need to be able to use that. do you know how to determine which is in the text box?

Thanks,

irishgirl
Reply With Quote
  #2  
Old 05-11-2004, 08:27 AM
thingimijig thingimijig is offline
Senior Contributor

* Expert *
 
Join Date: Jul 2003
Posts: 1,300
Default

try using the Isnumeric function.

thingimijig.
Reply With Quote
  #3  
Old 05-11-2004, 08:28 AM
darkforcesjedi's Avatar
darkforcesjedi darkforcesjedi is offline
Trust me, I'm an

* Expert *
 
Join Date: Apr 2001
Location: In ur base, pwnin d00dz
Posts: 1,964
Default

Code:
If not (text1.text like "*[!a-zA-Z0-9.]*") Then 'anything that's only words or numbers here such as "hi 0.5" 'but no other characters End If If not (text1.text like "*[!a-zA-Z]*") Then 'anything that's only LETTERs here like "thundering" End If If not (text1.text like "*[!0-9.]*") Then 'anything that's only NUMBERS and DECIMALS here like "0.5" End If If not (text1.text like "*[!0-9]*") Then 'anything that's only NUMBERS not DECIMALS like "345287" End If
hope this helps
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Determining row/column in a textbox lameboyadvance General 3 07-29-2002 05:12 PM
counting characters in a textbox macgyver2 General 2 05-22-2002 09:21 AM
How to check if entered in textbox has special characters angelbear General 14 05-13-2002 03:48 PM
Reding and editing characters in a textbox Bonzo General 6 12-15-2001 12:01 PM
Scroll Multiline textbox fizbim API 5 11-18-2001 04:35 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->