Re: Form instance using variable for name

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Your other option would be to iterate through the Forms collections, looping
through the controls of each one to find any of type acSubform, and testing
its SourceObject if it matches strFormName.

The code would need to be recursive to handle subforms at any nested depth.

Long way 'round for a shortcut.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Larry" <lljo40@xxxxxxxxxxxx> wrote in message
news:1133370216.892970.81850@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> If I open the macro in form view (the same code I posted without the
> "acDesign"), then the underlying code fires (which is not a good thing
> in this case). The subforms refer to the parent form in their open even
> and if they are opened alone, that causes an error to be thrown.
>


.