Home > Archive > Visual Basic Syntax > March 2005 > Edit text field
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| Hi guys, I'm a rookie in programming so please bare with me. I'm having a
little issue. I have a text field that receives a value once customer swipes
a card. Once the card is swiped, it populates the text field with something
like ;002520?
I'm not sure what the purpose of ; is but the ? is same as if you press the
<ENTER> key after putting the value. Now my recordset doesn't want to accept
this value as all corresponding fields in my table are numeric. Is there a
way I can format the text field so that when it looks up the value in the
table, it only searches for 2520?
Please advise
Thanks in advance
| |
|
| I've came up with a way to accomplish this. Although I don't know how to
write the syntax. Can anyone help me with the syntax to these steps?
1. Populate a string array with all characters of the textbox
2. If any character is not a number (i.e. not within vbKey0 to vbKey9), skip
to next character
3. Add all substring values from the array to a variable
Thanks
| |
| Rick Rothstein 2005-03-11, 4:07 am |
| > Hi guys, I'm a rookie in programming so please bare with me. I'm
having a
> little issue. I have a text field that receives a value once customer
swipes
> a card. Once the card is swiped, it populates the text field with
something
> like ;002520?
> I'm not sure what the purpose of ; is but the ? is same as if you
press the
> <ENTER> key after putting the value. Now my recordset doesn't want to
accept
> this value as all corresponding fields in my table are numeric. Is
there a
> way I can format the text field so that when it looks up the value in
the
> table, it only searches for 2520?
Assuming there is only ever one non-digit at the front of the string you
get from swiping the card...
SwipeValue = ";002520?"
NumericValue = Val(Mid$(SwipeValue, 2))
| |
|
| Thank you Rick...I really appreciate your help. I used that piece of code and
everything works just fine.
"Rick Rothstein" wrote:
> having a
> swipes
> something
> press the
> accept
> there a
> the
>
> Assuming there is only ever one non-digit at the front of the string you
> get from swiping the card...
>
> SwipeValue = ";002520?"
> NumericValue = Val(Mid$(SwipeValue, 2))
>
>
|
|
|
|
|