Solved

Extracting information from a Text Box

Posted on 2001-06-21
4
135 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

705 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now