I couldn't remember what the search string function was in Access,
until I saw it in another thread. Here is what I successfully pulled
your ID string out of your sample data with. It uses InStr to find the
leading ";" and the len function to find the trailing bit of the string
to the next "?".
If you may have data after this, just do a search in the string again
for the next "?" and modifiy the MID statement.
DesiredNumber :
Mid([SwipedNumber],InStr([SwipedNumber],";")+1,Len([SwipedNumber])-InStr([SwipedNumber],";")-1)
You can also use a similar routine to pull the name out of the data as
well, looking for the "%", "^", and "?" characters. I would have
figured you could program the swipe reader for exactly what you wanted
and not all the other stuff. Go figure.
Alex.
Fr***********@lakeheadu.ca wrote:
The following is what a sample of the mag info looks like when I do a
swipe. The first line is the name information, which varies in
length. The second line is what I need the access querry to read, but only
the number. The field is set up as text because we want the zero's to
show. How do I modify the line you gave me;
Me!DesiredNumber = Mid([SwipedNumber],2,8)
to also strip off the name info.
Can I use this line as an expression in a query or do I need to put
this into access code.
If I create sample database with a couple of records with the number
0166120 in an ID field, build a query to search for this number using
the mag reader, how would I go about this?
The following is a sample of the mag stripe info.
%FRANK^TEST?
;0166120?