Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Re-order of records in a Continuous Form

Status
Not open for further replies.

Hulm1

Technical User
Mar 11, 2008
100
GB
I have a form "Job_Edit" with a subform. The subform called "JobTask" is a continuous form and includes a look-up combo box for a range of tasks. After I choose say 4 separate tasks, I can print a report in the correct order no problem because I inserted a text box with control source =1 and running sum in the report.

However, when I close the form and re-open it, the selected tasks have been re-ordered by their TaskID no. which of course is an autonumber. I have been exploring DMax and even manually entering a no in a text box next to each task and trying to use Order By.

Unfortunately this has all proved beyond me! Ideally, I would like the sort order to always be that in which the tasks were selected. Also ideally, if a new set of numbers is required, I would prefer these to be automatic. BUT they need to start at No.1 for each job in "Job_Edit".

Any help much appreciated.

Thank you
 
Have you considered a date/time field rather than a number? This would ensure that the sort order is the order picked and it is easy to set up. You could use a ranking number if a number is required for print-outs.
 
I agree with Remou, but I think there is something else going on. If the Task ID is an autonumber by default this value increments which means the order will be as entered.

Unless you choose "random" instead of "increment" for the autonumber format, but that is not usually something a novice would do.

So it tells me there is likely another index on the table. So I would think you need to base the subform on a query sorted by TaskID. Or if there is something I am missing time stamp it as Remou suggested using =Now() as the default value for the time stamp (which could be hidden)
 
How are ya Hulm1 . . .

I'm not clear on the operation of the combobox. Could you [blue]be more specific?[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Thanks everyone, I will have a go with the Date/time. To answer TheAceMan1, When I said that the combo box looks up a range of tasks, what I meant was that it looks up a list of tasks from a table (tasks being the job tasks in the underlying table.

Meanwhile I take the point about the query and will set that up.

I will post an update on how I got on. I don't really need numbers and yes, they can be hidden. I had just blindly followed a path to generate some sort of dynamic counter
 
Thanks very much for your help. The date time, worked great!

Cheers

Quentni
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top