casting a subform/control to a form

scottydel

Registered User.
Local time
Today, 05:00
Joined
Apr 18, 2007
Messages
35
Hello,

I am using a subform, and when I want to access that subform's properties and methods in VBA from the Main Form's module, I have had to access it as a Control on the Main Form, i.e.

MainForm.Controls("Name of subform").Property/Method

The problem I am facing is, only the properties/methods associated with a Control are available to me in this way, but the properties/methods of a Form are not. This makes sense, because Access is seeing the subfrom as a Control on the Main Form (within the subform's module, I can access all properties/methods of the form, but within the Main Form's module, I cannot).

Not sure if Access is can recognize the type of a Control as a subform, and allow me to cast is as such, exposing the subform's properties/methods from the Main Form?

Maybe something more obvious than this is available, any ideas are appreciated!

Thanks,

Scott
 
Thanks again Bob, exactly what I needed. FYI, I searched first but didn't see that thread in my results.
 

Users who are viewing this thread

Back
Top Bottom