简体   繁体   中英

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'. 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. 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. 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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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