如何使用按钮重新排序任务列表? [英] How do I use buttons to reorder a list of tasks?

查看:81
本文介绍了如何使用按钮重新排序任务列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张用于跟踪工作的表单。每个作业作为我在数据表视图中使用子表单的任务列表。我希望能够拥有可以改变任务顺序的按钮。我真正需要的只是向上移动和向下移动按钮,但移至顶部和移到底部会好的。我有一个TaskOrder我可以手动填充的字段,但是当你想将任务移动到五个级别时,很难改变所有的数字。我猜我需要更新查询来更改值,然后重新查询表单,但我不知道要使用什么逻辑。

解决方案

< blockquote>只需获取要移动的行的两个唯一ID并更新它们。


如何获取其他记录的PK?获得当前记录的PK很容易。这只是其他记录的PK,我不知道该怎么做。


这取决于数据结构。


I have a form that I use to track jobs. Each job as a list of tasks for which I use a subform in Data Sheet view. I would like to be able to have buttons that can change the order of the tasks. All I really need are "Move Up" and "Move Down" buttons, but "Move to Top" and "Move to Bottom" would be nice. I have a "TaskOrder" field which I can populate manually, but when you want to move a task up five levels it gets hard to change all of the numbers. I''m guessing that I would need an update query to change the values and then requery the form, but I can''t figure out what logic to use.

解决方案

Just get the two unique ids of the rows you want to move and update them.


How do I get the PK of the other record? Getting the PK of the current record is easy. It is just the PK of the other record that I don''t know how to do.


That depends on data structure.


这篇关于如何使用按钮重新排序任务列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆