Moving records in the same table?

YZF

Registered User.
Local time
Today, 13:49
Joined
Nov 29, 2005
Messages
19
Hello there,

Is it possible somehow to move a record in the same table, to different row (in the form)? Or in other words, is it possible manualy adjust the position of records (rows) in a report?

I have a continuous form, where rows are filled with data (e.g. 10 rows ).Then i have report , which looks the same as form (rows, and their order). But sometimes user wants to move certain position (row) up or down, to be it on top or bottom or two places above, or below etc, of row list....is there any easy way to do it? Like some button press, where you could swap position with next record (next row) .....

Or just delete (everything) and fill again from beginning the way he wants...

Thanks!
 
you can order the forms by any fields ascending or descending in the form wizard, or change the properties somewhere i think
 
Thats not exactly what i wanted....i need to change row position by one from current, not all rows ascending or descending...
 
A table is inherently an unordered recordset. Once you know that fact, what you are asking does not make sense. I strongly recommend you read This Thread, one of numerous threads where Pat Hartman (one of the forum's resident gurus & MVP to boot!) explains it well.

Can you achieve the desired results by changing the sort order for your report? Is there a stable logic and structure to why you want one record displayed before another ?
 
YZF, trust me, you don't want to move records up and down in your table... What you want to do is a custom sort.
For that, you need to add a sort field to your table.
After that, you can make some wicked logic in VBA to respond to the users manipulation of the records.

Imagine a listbox with "move up" and "move down" arrows beside it...you select a record and click "move up"...your code would find the record with the next lower sort number, and basically 'swap' the two numbers in the two records. Then, you'd call a requery of the listbox and the two records have swapped! Later, use this field to sort your report.
 

Users who are viewing this thread

Back
Top Bottom