简体   繁体   English

检查Access 2010导航子窗体是否已打开

[英]Check if Access 2010 Navigation Subform is Open

I am developing a program to track client information that utilizes a navigation form as a main menu that is open at all times. 我正在开发一个程序来跟踪客户信息,该信息利用导航表单作为始终打开的主菜单。 Many of the subforms have list boxes that need to be requeried as data is entered/changed or the users tend to think that they haven't changed the recordset and we end up with duplicate data. 许多子表单都有列表框,需要在输入/更改数据时重新查询,或者用户倾向于认为他们没有更改记录集,我们最终会得到重复数据。 I can't figure out how to check if a specific subform of the navigation form is open before I run a refresh... they are all referenced as 'NavigationSubform'. 在运行刷新之前,我无法弄清楚如何检查导航表单的特定子表单是否已打开...它们都被引用为“NavigationSubform”。 So, for example, if I add a new job placement for a client, I'd like to run a requery of this listbox in the 'onclose' event to make sure they have the newest info. 因此,例如,如果我为客户添加新的职位空缺,我想在'onclose'事件中运行此列表框的重新查询,以确保它们具有最新信息。 I can do it... Forms!navMain!NavigationSubform.Form.lstEmployment.Requery ... but it bombs if the user has changed panes on the navigation form before closing the form. 我可以做到......表单!navMain!NavigationSubform.Form.lstEmployment.Requery ...但如果用户在关闭表单之前更改了导航表单上的窗格,则会发生炸弹。 This happens a lot: for example, a client interrupts while you are entering Job Placement info and you stop and enter a counseling note before going back to it, leaving the main menu sitting in the 'Clinical' directory. 这种情况发生了很多:例如,当您输入工作放置信息时,客户端会中断,您在返回之前停止并输入咨询说明,将主菜单保留在“临床”目录中。 Is there a way to check if a specific subform is loaded within the Navigation Subform object? 有没有办法检查导航子窗体对象中是否加载了特定的子窗体? I've attached a screen shot in the event it helps this make sense. 我已经附加了一个屏幕截图,它有助于这有意义。

Thanks in advance for any suggestions!! 在此先感谢您的任何建议!!

Employment Screen 就业筛选

It has been a while but I believe you can use the isLoaded method to determine if a subform is loaded 已经有一段时间但我相信您可以使用isLoaded方法来确定是否加载了子表单

http://msdn.microsoft.com/en-us/library/office/ff194656.aspx http://msdn.microsoft.com/en-us/library/office/ff194656.aspx

hope this helps, Brent 布伦特,希望这会有所帮助

You can check the contents of a subform control with the source object property, for example: 您可以使用源对象属性检查子窗体控件的内容,例如:

forms!mainform.asubformcontrol.sourceobject

You can also get the name of the form from the form object: 您还可以从表单对象中获取表单的名称:

forms!mainform.asubformcontrol.form.name

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

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