vba 如何刷新列表框

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1823805/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 11:03:40  来源:igfitidea点击:

How to refresh listbox

ms-accessvbalistboxrefresh

提问by Joe Bloggs

What's the best way to refresh a list box in MS Access? The way I have tried it doesn't seem to work :-/

在 MS Access 中刷新列表框的最佳方法是什么?我尝试过的方式似乎不起作用:-/

This is my current method (onClick event of a button on the same form):

这是我当前的方法(同一表单上按钮的 onClick 事件):

Me.orders.Requery

I have also tried

我也试过

orders.Requery

and

Forms!currentOrders.orders.Requery

but none of them seem to refresh the list box's contents - I see no new items, even though I knowthat there are some. Closing off the form, and then re-opening it does show the new items, however.

但它们似乎都没有刷新列表框的内容 - 我没有看到新项目,即使我知道有一些。但是,关闭表单,然后重新打开它确实会显示新项目。

回答by SwDevMan81

You could try and requery the form first and then requery the listbox

您可以尝试先重新查询表单,然后重新查询列表框