如何在 Access Web 兼容表单中选择组合框的第一项?
我已在 SharePoint 2010 上创建了一个 Access Web 数据库,并且正在使用 Access 2010 编辑其表单。
一个表单包含我按照这些教程创建的一组级联组合框 Access 中的组合框 和 级联组合框。实际的数据绑定按预期工作。
问题是,当级联组合框收到其绑定值时,所选项目留空,我希望它默认选择第一个元素,即combo.items(0)
我知道我必须添加一些排序宏来选择第一个元素。但是,我还没有找到一种方法来做到这一点。
目前,主组合框通过更新后事件调用级联组合上的重新查询操作。
是否还有其他操作可以强制选择第一个绑定项目?
I've created an Access Web database on SharePoint 2010 and I'm editing its forms with Access 2010.
One form includes a set of cascading combo boxes that I've created following these tutorials
Combo Box in Access and Cascading Combo Boxes. The actual data binding is working as expected.
The issue is that when the cascaded combo boxes receive their bound values, the selected item is left blank and I'd like it to pick the first element by default i.e. combo.items(0)
I understand that I'll have to add some sort of macro to select the first element. However, I haven't found a way to do so.
Currently the primary combo boxes invoke through an after update
event a requery
action on the cascaded combos.
Is there another action that could force as well the selection of the first bound item?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看 http://www.access-programmers.co .uk/forums/showthread.php?t=38754
您可以在 OnLoad 上执行此操作。因此,表单后面的 VBA 代码将类似于:
您可能需要使用 Column(N, N) 上的索引 - 上面的示例帮助我将数据行源中的第一个条目放在开始时的组合中。
Take a look at http://www.access-programmers.co.uk/forums/showthread.php?t=38754
You can do this trick OnLoad. So your VBA code behind the form will look something like:
You may need to play around with the indices on Column(N, N) - the example above worked for me to place the first entry from my data rowsource in the combo at start.