non-standard text import

  • Thread starter Bill Cunningham
  • Start date
B

Bill Cunningham

I have a need to import data from a scan of a drivers license. The scan
creates 22 lines of text. It contains data that has each field on a line. For
example:

DAAWilliam A. Cunningham
DAB1921 Lake Shore Drive
DACBloomer
DADWI
DAE65724
DAF19820405

I have been able to scan this information into a memo field and would like
to be able to create a single record. The goal is to verify the information
and calculate the age of the customer.

I'm sure there is a way to read tme memo and convert DAF into the Date of
Birth and verify that this guy has been carded and can buy me a beer.
 
B

bhicks11 via AccessMonster.com

I convert some files like this by first opening in Excel and running a macro
that copies the lines, uses PASTE SPECIAL, Transpose until the file is
completed.

Bonnie
http://www.dataplus-svc.com
 
B

Bill Cunningham

Thanks Bonnie,
I appreciate your response.

I can do that but I need to do it in one motion. I need to scan the DL and
see the customer's age.

I may need to create some VBA code. I'm hoping to get some help with that.
 
K

KARL DEWEY

Try this --
Age: DateSerial(Mid([YourMemo], InStr([YourMemo], "DAF")+3,4),
Mid([YourMemo], InStr([YourMemo], "DAF")+7,2), Mid([YourMemo],
InStr([YourMemo], "DAF")+9,2))
 
R

Ron2006

It will take a little vba but

lookup instr function

It can be used to get the position of the DAF part and then the mid
command using that displacement (+3) will put you at the start of the
birthdate.

Ron
 
M

Mike Painter

Bill said:
I have a need to import data from a scan of a drivers license. The
scan creates 22 lines of text. It contains data that has each field
on a line. For example:

DAAWilliam A. Cunningham
DAB1921 Lake Shore Drive
DACBloomer
DADWI
DAE65724
DAF19820405

I have been able to scan this information into a memo field and would
like to be able to create a single record. The goal is to verify the
information and calculate the age of the customer.

I'm sure there is a way to read tme memo and convert DAF into the
Date of Birth and verify that this guy has been carded and can buy me
a beer.

Try the Split Function. Powerful and almost always easier than Instr.

Dim CardInfo() as string

CardInfo = Split(YourTextString, "^P") "or whtever the delimiter is that
gives the line feed

CustName = CardInfo(0)
....
DOB = CardInfo(5)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top