PC Review


Reply
Thread Tools Rate Thread

Checking wether a karakter is a number

 
 
Erwin Bormans
Guest
Posts: n/a
 
      23rd Mar 2011
Dear,

I've got a string for example:

"NECO 101880 941 NECO KOZIJNEN"

This string is never the same, but i need the 101880 nr.

Is there a way i can check wether a karakter in that string is a number or
not?

Thanks in advance,
Kind regards,
Erwin

 
Reply With Quote
 
 
 
 
Douglas J Steele
Guest
Posts: n/a
 
      26th Mar 2011
Unfortunately, you'll get false positives with that approach, since, for
example, IsNumeric("1E2") returns True (Access assumes the E is an exponent,
so that that equals 100)

You may want to use

If Str(Val(strTestString(I))) = strTestString(I) Then
MsgBox "Token number " & I & " is numeric."
End If



"Bill" wrote in message
news:(E-Mail Removed)...

You could do something like:

Option Compare Database
Option Explicit
Private Sub TestSub()

Dim strTestString() As String
Dim strMyString As String
Dim I As Integer

strMyString = "NECO 101880 941 NECO KOZIJNEN"
strTestString = Split(strMyString, " ")

For I = 0 To UBound(strTestString)
If IsNumeric(strTestString(I)) Then
MsgBox "Token number " & I & " is numeric."
End If
Next

End Sub


"Erwin Bormans" <(E-Mail Removed)> wrote in message
news:%ckip.80037$(E-Mail Removed)2...
> Dear,
>
> I've got a string for example:
>
> "NECO 101880 941 NECO KOZIJNEN"
>
> This string is never the same, but i need the 101880 nr.
>
> Is there a way i can check wether a karakter in that string is a number or
> not?
>
> Thanks in advance,
> Kind regards,
> Erwin


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Karakter neden siliniyor? Modern Talking Microsoft Word Document Management 1 20th Oct 2008 05:26 AM
Checking wether a socket is closed Nuno Magalhaes Microsoft C# .NET 2 1st Dec 2005 10:28 AM
Checking wether a file is XML or plain text? =?Utf-8?B?U3RhbXBlZGU=?= Microsoft C# .NET 2 28th Jul 2005 09:32 AM
change karakter for image ruud.hofman@rotosmeets.com Microsoft Access Forms 1 5th Nov 2003 01:54 PM
change karakter for image Ruud Microsoft Access Form Coding 0 5th Nov 2003 12:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:57 AM.