PC Review


Reply
Thread Tools Rate Thread

Automatically assign Ranking based on Time taken

 
 
=?Utf-8?B?TmlnZWw=?=
Guest
Posts: n/a
 
      1st May 2006
I have a form where a time is entered in seconds in each row ie 103.36 102.23
etc. Also in that form I have a position filed, what I am trying to do is for
some code to scroll thru the form and assign a ranking to each record based
on the number of seconds. Ie the lowest would be 1 and so on. Does anyone
have any idea how this would be done

Thanks
 
Reply With Quote
 
 
 
 
Marshall Barton
Guest
Posts: n/a
 
      1st May 2006
Nigel wrote:

>I have a form where a time is entered in seconds in each row ie 103.36 102.23
>etc. Also in that form I have a position filed, what I am trying to do is for
>some code to scroll thru the form and assign a ranking to each record based
>on the number of seconds. Ie the lowest would be 1 and so on. Does anyone
>have any idea how this would be done



This is relatively easy to do using a query with a subquery:

SELECT T.person,
(SELECT Count(*)
FROM thetable As X
WHERE X.seconds <= T.seconds
) As Position
FROM thetable As T

But it would take a sort algorithm operating on the form's
recordset to do it in code. If you use a query like the
above as the form's record source, then the only code you
would need is
Me.Requery
whenever you want to display the new positions after
entering/editing some time values.

--
Marsh
MVP [MS Access]
 
Reply With Quote
 
Van T. Dinh
Guest
Posts: n/a
 
      1st May 2006
Try Stephen Lebans' RowNumber:

http://www.lebans.com/rownumber.htm

--
HTH
Van T. Dinh
MVP (Access)



"Nigel" <(E-Mail Removed)> wrote in message
news:134B38FC-F82C-4885-A3FE-(E-Mail Removed)...
>I have a form where a time is entered in seconds in each row ie 103.36
>102.23
> etc. Also in that form I have a position filed, what I am trying to do is
> for
> some code to scroll thru the form and assign a ranking to each record
> based
> on the number of seconds. Ie the lowest would be 1 and so on. Does anyone
> have any idea how this would be done
>
> Thanks



 
Reply With Quote
 
=?Utf-8?B?TmlnZWw=?=
Guest
Posts: n/a
 
      1st May 2006
OK I am halfway there

I have the record number now I need to be able to click an button on the
form and have it loop thru each record on the form and place the value from a
field called rownum into a field called position. Once it reaches the last
record stop

"Van T. Dinh" wrote:

> Try Stephen Lebans' RowNumber:
>
> http://www.lebans.com/rownumber.htm
>
> --
> HTH
> Van T. Dinh
> MVP (Access)
>
>
>
> "Nigel" <(E-Mail Removed)> wrote in message
> news:134B38FC-F82C-4885-A3FE-(E-Mail Removed)...
> >I have a form where a time is entered in seconds in each row ie 103.36
> >102.23
> > etc. Also in that form I have a position filed, what I am trying to do is
> > for
> > some code to scroll thru the form and assign a ranking to each record
> > based
> > on the number of seconds. Ie the lowest would be 1 and so on. Does anyone
> > have any idea how this would be done
> >
> > Thanks

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Automatically assign a value based on rotating list Mike Painter Microsoft Access Form Coding 0 10th Mar 2009 11:27 PM
Re: Automatically assign a value based on rotating list Jeff Boyce Microsoft Access Form Coding 1 10th Mar 2009 09:43 PM
Create Task and Assign Time Automatically TJAC Microsoft Outlook Discussion 1 11th Jul 2008 02:52 PM
Outlook 2007 Beta TR: How to automatically assign categories to email based on sender/recipient? ben.reichman@gmail.com Microsoft Outlook Discussion 1 18th Sep 2006 04:20 PM
How do I automatically assign a task priority based on due date? =?Utf-8?B?QnVkZHlMZWU=?= Microsoft Outlook Discussion 2 28th Apr 2006 06:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:03 AM.