Code to generate unique id with criteria

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

Hope you can help me on this one, as its really hurting my head…

Firstly think logistically (IE delivery company main depot).

There is a security staff database which holds data on all vehicles going in
and out of the depot (In this problem I am looking at the trunk vehicles,
which delivery goods to other outbases for them to make deliveries)

At present they just enter the vehicle data and that’s it, like a log.
I need code to allocate a unique ID number to each trunk as it arrives that
day and update a TrunkID field on that vehicle record.

As an example: (Key: T1 = Trunk 1)

DepotName TimeIn TrunkID Date
…………… ………. ..……… ………..
Manchester 21:13 T1 12/02/06
Croydon 22:26 T1 12/02/06
Manchester 22:31 T2 12/02/06
Manchester 00:46 T3 13/02/06

However there are very specific criteria for this allocation.
Trunking starts daily at around 8pm and finishes at 8am, therefore when
after Trunking has finished for that day, the unique number needs to start
again back at T1.

It must also be outbase specific, IE each outbase must start on T1 then
increase when each trunk arrives and gets logged in at security.

Only problem I see is if we use the TimeIn field to use to find the last
record of that specific day for that outbase, what will happen when the clock
rolls round to 00:00 as the allocation must continue until 8am.

This will all need to happen when a drop down containing the depot names is
updated with the depot name for that trunk record.

At first I thought this would be simple, big no no from me as it's kind of
snowballed with criteria :-(

Lastly, I could do with as much in depth info on the code as possible please
guys

Please give me a shout if you need any more info to work with.
Thanks so much!
David
 
Hi again all,

I am still trying different ideas but this is well out of my league!

If possible could anyone email me with ideas as wont be able to get online
for a few days now.
(e-mail address removed)

Again many thanks everyone!
Davey
 
Back
Top