Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 13th, 2005, 12:37 PM
prime80
Guest
 
Posts: n/a
Default Updating project rankings automatically - Help needed

I'm building a project database to keep track of the various
engineering projects ongoing in our department. These projects will be
grouped by priority ([cmbPriority]=High, Medium, Low) and ranked within
the priority ([Rank]=1,2,3,etc.). What I'd like for it to do is
automatically update rankings when a project rank is changed, a new
project comes in, or a project is completed. For example, let's say
there are 4 high priority projects. If High #2 is changed to High #4,
then old High #3&4 should become High #2&3. Or, if High #2 is
completed, then High #3&4 should become High #2&3. If we add a new
project and rank it High #3, then High #3&4 should become High #4&5.
I'm assuming I'm going to have to use an append query for this, but I
just can't seem to figure it out to cover all of the scenarios. Any
help would be GREATLY appreciated.

  #2  
Old November 13th, 2005, 12:37 PM
jimfortune@compumarc.com
Guest
 
Posts: n/a
Default Re: Updating project rankings automatically - Help needed

prime80 wrote:[color=blue]
> I'm building a project database to keep track of the various
> engineering projects ongoing in our department. These projects will be
> grouped by priority ([cmbPriority]=High, Medium, Low) and ranked within
> the priority ([Rank]=1,2,3,etc.). What I'd like for it to do is
> automatically update rankings when a project rank is changed, a new
> project comes in, or a project is completed. For example, let's say
> there are 4 high priority projects. If High #2 is changed to High #4,
> then old High #3&4 should become High #2&3. Or, if High #2 is
> completed, then High #3&4 should become High #2&3. If we add a new
> project and rank it High #3, then High #3&4 should become High #4&5.
> I'm assuming I'm going to have to use an append query for this, but I
> just can't seem to figure it out to cover all of the scenarios. Any
> help would be GREATLY appreciated.[/color]

This is not a trivial problem so: <BeginHandWavingMode> I think the
cleanest way to do this is using linked lists. Linked lists can be
implemented in Access by using a Long field to contain the value of an
ID field (simulated pointer). Each item in each priority list points
to the next item. You'd need Add, Move (reprioritize Rank within a
Priority Group or Delete and Add to a different Priority Group) and
Delete operations. Most data structures books explain how to do these
operations in detail, especially the one by Nicolas Wirth. Hint: The
people in this NG love answering questions like this so you probably
don't need to visit the library.

Maybe the first rank element in the linked list (for a given priority
group) could contain a marker. This marker may need to be moved
depending on the operation. With three different markers one table
could hold all three linked lists. A single table would make it
somewhat easier to move between Priority Groups. You'd want to use a
form to handle these operations. Then you'd need a way to traverse the
lists to update priority numbers so that the data can be displayed
easily in a query. A Null value for the next ID would terminate the
list. There's potential ugliness any way you implement it. If you
don't want to use linked lists you can remove Rank number 3 and then
run an update query to subtract 1 from any Rank > 3 (within the
Priority Group) etc. Either way, you still have to deal with what to
do when the priority list is empty and other gotchas.
<EndHandWavingMode>

I hope someone comes up with something much easier.

James A. Fortune

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles