Non-standard 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 the memo and convert DAF into the Date of
Birth and verify that this guy has been carded and can buy me a beer.
 
A

Albert D. Kallal

If you placed a button on the form, the code behind that button to take the
memo text and create a new reocrd would be:


Dim rst As DAO.Recordset
Dim vBuf As Variant
Dim strBir As String

vBuf = Split(Me.text1, vbCrLf)

rst!FullName = Mid(vBuf(0), 4)
rst!Address = Mid(vBuf(1), 4)
rst!City = Mid(vBuf(2), 4)
rst!State = Mid(vBuf(3), 4)
rst!Zip = Mid(vBuf(4), 4)
rst!LicNum = Mid(vBuf(5), 4)
strBir = Mid(vBuf(6), 4)

rst!birthdate = DateSerial(Left(strBir, 4), _
Mid(strBir, 5, 2), Right(strBir, 2))
rst.Update
rst.Close

In the above form, the memo field is bound to a text box called text1, and
you would change that to your needs.
 

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