Expand only the subdatasheets you want
Today's guest blogger is Pavlo Pedan of ARGO Business Corp. He has 15 years of experience with Access and has a great site of tips at http://sites.google.com/site/msaccesscode/.
If you have a form that contains subdatasheets, you can use the following VBA command to expand all of them:
Forms![FormName]![SubFormName].Form.SubdatasheetExpanded = True
However, we often want only some of the subdatasheets to be expanded, based on
some criteria (for example - expand only if subdatasheets contain data.)
Watch a short video demo and download a demo database from this page. Make sure you have added a reference to the "Accessibility" library (%windir%\system32\oleacc.dll).
This has been tested on Access 2007.