[AccessD] adding control number

Andy Lacey andy at minstersystems.co.uk
Fri Aug 26 05:45:33 CDT 2005


I agree wholeheartedly with Lonnie. That's what I'd do. It was an
interesting exercise doing it in one shot but I wouldn't want to have to
maintain that.
--
Andy Lacey
http://www.minstersystems.co.uk




--------- Original Message --------
From: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
To: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
Subject: Re: [AccessD] adding control number
Date: 26/08/05 10:33



Why not write a function in VBA and do everything you just said instead of
using your queries? How is your VBA?

pedro at plex.nl wrote:Hello Group,

I have an ID (text, because it begins with 00) that exist of 8 numbers.
I need to change this ID by removing the first 0, and by adding a extra
control number.
This control number can be calculated from this ID. This can be done by
several query’s. Is it possible to do in one query??

For example.

I have ID: 00327833

Take the number of the odd positions: 0 3 7 3

Place these numbers behind each other to make one number: 0373

Multiply this number with 2: 0373 x 2 = 0746

Count up the separate numbers from this last multiplication: 0 + 7 + 4 + 6 =
17

>From the original ID, take the even positions: 0 2 8 3

Count up the separate numbers from the even positions with the sum of the
last count up: 17 + 0 + 2 + 8 + 3 = 30

The last number of the previous sum is the extra control number: 0

>From the original ID, remove the first 0 and add the control number:
03278330


Who can help me with this?

TIA

Pedro Janssen

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




May God bless you beyond your imagination!
Lonnie Johnson
ProDev, Professional Development of MS Access Databases
Visit me at ==> http://www.prodev.us












---------------------------------
Start your day with Yahoo! - make it your home page
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

________________________________________________
Message sent using UebiMiau 2.7.2




More information about the AccessD mailing list