Looking for help eith VBA string manipulation

B

Brenda

Hello all!

I am desperately seeking help for a few lines of VBA code that I am stuck
on. I have a strip reader that reads encoded drivers license information for
which I am attempting to display whether or not a DL is expired when swiped.
There are two strings that I need to combine for this which are the date of
birth and expiration date.

The expiration date comes across as 4 digit string representing the last two
digits of the year first and then the two digits of the month.

example - 1108 would be the 8th month of 2011

The DOB contains the exact day it expires. It comes across a 8 digit string
representing the year born first, month born 2nd and lastly the day born.

example - 19620830 would be August 30th, 1962.

I am looking to remove the 2 digit year from the expiration string and
combine it with the dob string to create a new string 20110830 and then place
it into a field called DL_Expir.

Any ideas?

Thank you for taking time to read this,

Sheryl
 
C

CompGeek78

Hello all!

I am desperately seeking help for a few lines of VBA code that I am stuck
on.  I have a strip reader that reads encoded drivers license information for
which I am attempting to display whether or not a DL is expired when swiped.  
There are two strings that I need to combine for this which are the date of
birth and expiration date.

The expiration date comes across as 4 digit string representing the last two
digits of the year first and then the two digits of the month.

example - 1108 would be the 8th month of 2011

The DOB contains the exact day it expires.  It comes across a 8 digit string
representing the year born first, month born 2nd and lastly the day born.

example - 19620830 would be August 30th, 1962.

I am looking to remove the 2 digit year from the expiration string and
combine it with the dob string to create a new string 20110830 and then place
it into a field called DL_Expir.

Any ideas?  

Thank you for taking time to read this,

Sheryl

One of the rules of database design is "One field, one piece of data."
This means that you shouldn't store more than one piece of information
in a field in your table. If you want that data, feel free to build it
for display on forms/reports but don't store it in your tables.

In order to build what you want you need to use:

"20" & left(expirationdate,2) & right(dob,4)

That takes the left 2 characters of the expiration date and combines
it with the right 4 characters of the DOB.

Keven Denen
 

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