Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
OfMartin
Starting Member
11 Posts |
Posted - 2005-04-15 : 14:23:43
|
I'm creating a Visual Basic form that reads barcode in a textbox property inputed by the user. I need my textbox to read only ALPHA-NUMBERIC characters. If it doesn't read alphanumber characters, i have a read-only textbox that gives the user a warning if the input is not alphanumeric. The barcode that should be inputed alphanumerically would typically look like this "C098093240". Here's what I have so far...This code actually checks to see if the input is "numeric". I'm really stuck on this logic. I really need help bad. I've got a feeling all I need to is change around the coding within the quotation marks to make it read alphanumeric, but its just a hunch.Dim x As Int16Dim strNew As String = ""'Review all characters in the txtBarcode text box to ensure that they are numeric digits'Loop through all characters and pass numeric digits to a new stringFor x = 0 To Len(txtBarcode.Text) - 1If InStr("0123456789", txtBarcode.Text.Substring(x, 1)) > 0 Then ' Char is alpha-numericstrNew += txtBarcode.Text.Substring(x, 1)Else ' Char is not alpha-numericBeep() ' Warn userlblHelp.Text = "Character is not numeric"End IfThanks a lot everyone,OfMartin890@yahoo.com |
|
|
|
|