Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ISIN Checker

Status
Not open for further replies.

joemal

Programmer
Feb 12, 2003
13
MT
I want to build an ISIN check validation routine. Can someone help? The ISIN is 2characters and 10 digits.
 
Regular Expression (as detailed in VBHelp) will probably provide the easiest answer for checking after the event.

If you are checking a typed entry in a textbox, then validate each keystroke in the keypress event by comparing KeyAscii with allowed values - you'll still need to check in the validate event in case the user cut&pasted

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
There are a number of solutions. Here's one using Regular Expressions:
[tt]
' Add a reference to Microsoft VBScrip Regular Expressions library
Private Function TestISIN(strTest As String) As Boolean
With New RegExp
.Pattern = "^\w{2}\d{10}$"
TestISIN = .Test(strTest)
End With
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top