MS Access 2003 - 自动显示表单列表框中的最后一条记录而不是第一个记录
所以我有一个表单,其中有一个像分类帐一样显示的列表框。我的问题是如何让它显示最后一条记录(或者将滚动条默认显示在底部而不是顶部),而不是默认显示前几条记录。
现在我的意思并不是从下到上而不是从上到下反转顺序(尽管学习如何做这将是一件很酷的事情),只是简单地显示列表的底部(就滚动条而言)和默认值,以便它始终显示最后 10 条左右的记录(基于我制作列表框的大小)。
所以我认为这很简单,但话又说回来,我显然不知道?!?!
谢谢!
So I have a form that has a listbox that shows like a ledger. My question is how can I make it display the last records (or have the scroll bar default to the bottom instead of the top), instead of the first few as the default.
Now I don't mean reversing the order from bottom to top instead of top to bottom (though that would be a cool thing to learn how to do), just simply having the bottom of the list (in terms of the scroll bar) shown and the default, so that it is always showing the last 10 or so records (based on the size that I made the list box).
So i think this is simple, but then again, I obviously do not know?!?!
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在合适的事件中,例如当前事件:
In a suitable event, such as the current event:
您可以向表单加载事件添加一些代码,以便它执行以下操作:
它基本上选择列表框中的最后一项,以便向下滚动到它,然后取消选择它。
You could add some code to the form load event so that it will do this:
It basically selects the last item in the list box so it will scroll down to it, and then unselects it.
我知道这是稍后的事,但也许这会对将来遇到此线程的人有所帮助。这是我用来转到最后一条记录然后取消选择最后一条记录的代码。
I know this is later but maybe this will help someone in the future who comes upon this thread. This is the code I used to go to the last record then unselect the last record.
你是如何设置列表框项目的?它们来自数据库吗?如果是,那么您需要使用“order by columnName”更新 SQL 语句。
How did you set the listbox items? Are they from a database? If yes, then you need to update the SQL statement with an "order by columnName".