为什么我的“重新查询”不会命令排序结果? [英] Why won't my "requery" command sort the results?

查看:44
本文介绍了为什么我的“重新查询”不会命令排序结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表单(frmEmployee),其中包含一个名为SystemID的字段。我还有一个查询,查找当前使用的所有系统ID,并按数字顺序对它们进行排序。此查询是表单frmEmployee上的子表单的基础。此子表单的目的是能够查看正在使用的系统ID,以便在输入新员工时可以使用新的系统ID。在SystemID字段中,我有一个AfterUpdate事件,它重新查询子表单,以便它注册新的系统ID或更改的系统ID。我的问题是,如果我将系统ID从20更改为不存在的13,那么子表单将其列为12,14,15,16,17,18,19,13,21。如果我然后将其更改回原来的20,然后它显示12,20,14,15,16,17,18,19,21。如果我点击功能区中的刷新记录按钮,那么排序工作。为什么在重新查询子表单时不能从查询中进行排序?

I have a form (frmEmployee) with a field called SystemID. I also have a query that finds all of the system IDs currently used and sorts them in numerical order. This query is the basis for a subform on form frmEmployee. The purpose of this subform is to be able to see what system IDs are being used so that a new system ID can be used when entering a new employee. In the SystemID field, I have an AfterUpdate event that requeries the subform so that it registers the new system ID or a changed system ID. My problem is that if I change a system ID from 20 to a non-existent 13, then the subform lists it as 12, 14, 15, 16, 17, 18, 19, 13, 21. If I then change it back to the original 20, then it shows 12, 20, 14, 15, 16, 17, 18, 19, 21. If I click on the refresh records button in the ribbon, then the sort works. Why doesn''t the sort from the query work when the subform is requeried?

推荐答案

它看起来像你的工作,但你在做错误的地方。没有更多信息很难说更多,但这应该告诉你至少在哪里看。
It looks like what you have works, but you''re doing it in the wrong place. It''s hard to say more without more info, but that should tell you where to look at least.


什么是错误的地方?我的requery代码?
What is in the wrong place? My requery code?


我猜是这样的。这里的信息很少,很难确定,但你所显示的结果的顺序是一个线索。
I''m guessing so. There''s so little info here it''s hard to be sure, but the ordering of the results you''ve displayed is a bit of a clue.


这篇关于为什么我的“重新查询”不会命令排序结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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