简体   繁体   English

MS Access VBA以连续形式将当前选择/记录设置为null

[英]MS Access VBA to set current selection/record to null on a continuous form

I have a form with a subform that is a continuous form. 我有一个带有连续形式的子表格的表格。 I have a tab control that displays information related to the record selected in the continuous form; 我有一个标签控件,用于显示与以连续形式选择的记录有关的信息; the tab control displays as soon as a record is selected/clicked. 一旦选择/单击记录,就会显示选项卡控件。 That all is grand. 一切都很棒。

However, after the user updates information in the tab control and clicks a button, I want to hide the tab control until a record is actually clicked on the continuous form. 但是,在用户更新选项卡控件中的信息并单击按钮之后,我想隐藏选项卡控件,直到在连续表单上实际单击记录为止。

What is currently happening is that the first record in the continuous subform is selected and I'd like for no record to be selected. 当前正在发生的情况是,连续子表单中的第一条记录已被选中,我希望没有任何记录被选中。

Is there a way to set the current record/selection of a continuous form to nothing or null? 有没有办法将当前记录/连续形式的选择设置为空或为空? I've tried setting the bookmark on the continuous form to null in the button click event using Parent.SubApptList.Form.Bookmark = Null and that does not work for me. 我尝试使用Parent.SubApptList.Form.Bookmark = Null在按钮单击事件中将连续表单上的书签设置为null,这对我不起作用。

Seems like it should be easy, but I can't figure it out. 似乎应该很容易,但我无法弄清楚。

After the button click event could you set focus to the parent form? 在按钮单击事件之后,您可以将焦点设置到父表单吗? Doing this would force the user to click on a record. 这样做将迫使用户单击记录。 Maybe I'm not fully understanding exactly what you're trying to do but if all you want is for nothing to have focus after a button event then that's the route I would take. 也许我没有完全理解您要尝试做的事情,但是如果您只想在按钮事件后没有任何关注的话,那就是我要采取的方法。 That's assuming you don't having any on focus events for thr main form. 假设您没有任何主要形式的焦点事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM