Solved

Extracting information from a Text Box

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MS Acccess - Update Field in Table when report is printed 6 47
vbModal 12 57
MS Access 03, TransferText, decimal places 8 78
Export Data to Different .csv Files 26 115
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

830 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