Solved

Extracting information from a Text Box

Posted on 2001-06-21
4
138 Views
Last Modified: 2010-05-02
Hi,
I am writing an application in which we scan the new CreditCard Type State ID's or Drivers Liscense for Customer Information - The Format that scan's into a TextBox is:%STATECITY^LASTNAME$FIRSTNAME$MIDDLEINITIAL^ADDRESS^?;########STATEID#=##############=?

I want to place the value's into other text boxes to save time on filling out customer info ie:
State to txtState
City to txtCity
LastName to txtLastName
FirstName to txtFirstName
StateID to txtStateID

I have tried several ways without success.
The ## signs seem to be irrelevant information to what I need - I just want to extract the information shown above.

Thanks for looking into my question.

0
Comment
Question by:flosoft
  • 2
  • 2
4 Comments
 
LVL 20

Expert Comment

by:hes
ID: 6215735
Try this (vb6 only)
Dim MyInfo1
Dim Myinfo2
Dim MyInfo3

MyInfo1 = Split(text1'or where else you get the data,"^")

This will put STATECITY in MyInfo1(0)
LASTNAME$FIRSTNAME$MIDDLEINITIAL in MyInfo1(1)
ADDRESS in MyInfo(2)
?;########STATEID#=##############=? in MyInfo(3)

Then
MyInfo2 = split(MyInfo(1),"$")

lastname will be in MyInfo2(0) and so forth
MyInfo(3) = replace(MyInfo(3),"?","")
MyInfo(3) = replace(MyInfo(3),";","")
MyInfo(3) = replace(MyInfo(3),"#","")
MyInfo(3) = replace(MyInfo(3),"=","")




0
 

Author Comment

by:flosoft
ID: 6225632
I just wanted to let you know that I am experimenting with the code and will make a decision in the next day or 2 - Thanks/.
0
 
LVL 20

Accepted Solution

by:
hes earned 100 total points
ID: 6227614
Whoops,
Just noticed something, a little ( ;) ) typo
This
ADDRESS in MyInfo(2)
?;########STATEID#=##############=? in MyInfo(3)

should be
ADDRESS in MyInfo1(2)
?;########STATEID#=##############=? in MyInfo1(3)

And this

MyInfo(3) = replace(MyInfo(3),"?","")
MyInfo(3) = replace(MyInfo(3),";","")
MyInfo(3) = replace(MyInfo(3),"#","")
MyInfo(3) = replace(MyInfo(3),"=","")


Should be
MyInfo1(3) = replace(MyInfo1(3),"?","")
MyInfo1(3) = replace(MyInfo1(3),";","")
MyInfo1(3) = replace(MyInfo1(3),"#","")
MyInfo1(3) = replace(MyInfo1(3),"=","")

Must have been typing to fast LOL








0
 

Author Comment

by:flosoft
ID: 6230004
Thanks,
It took some experimenting, and with a little modification I got it to work perfectly, Then to my suprise I scanned in another ID, same state, issued 2 month's apart and they use an entirely different format! Go Figure! The second had only numbers which only gave the State ID - hmmmmm, Well at least for proccesing customers with the format that mine has it will quick and painless thanks to your help.

Thanks again,
Tom
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question