By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,456 Members | 1,251 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,456 IT Pros & Developers. It's quick & easy.

Drag n drop techniques

P: n/a
Hello all,

Does anyone know how to use drag n drop techniques/command button to change
the order that records will be displayed on a form?

To illustrate, suppose I have 3 records a,b,c stored in that order. Is there
a button I could use to promote, say record b so that it is first?

Thank you in advance,

Adonis.
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Here's some guidance ---

There are only three ways to sort data: alphabetical, numerical or by a
sortorder field containing an integer or long integer from 1 to the number
of records. Using a sortorder field is done when either of the the other two
don't work. In your case, alphabetical or numerical won't work so the first
thing you need to do is add a sortorder field to your table and fill it with
the proper numbers. Now on your form, you need a hidden textbox for each
record that contains the value of sortorder for that record. To change the
order of where a record appears, write code in the MouseDown event that
retrieves the value of SortOrder for the record you selected. Write code in
the MouseUp event that retrieves the value of the record where you want to
move the selected record to, assigns that value to SortOrder of the selected
record, increments the value of SortOrder for the record you moved to to the
last record by 1and does a requery.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Adonis Walmsley-McCarthy" <aw*******@blueyonder.co.uk> wrote in message
news:sk*******************@fe2.news.blueyonder.co. uk...
Hello all,

Does anyone know how to use drag n drop techniques/command button to change the order that records will be displayed on a form?

To illustrate, suppose I have 3 records a,b,c stored in that order. Is there a button I could use to promote, say record b so that it is first?

Thank you in advance,

Adonis.

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.