Open retailcoder opened 8 years ago
Reports have a Report_
prefix.
IIRC, the Form and Report components vary by the version of Access (or perhaps it's the Access file format), so the behavior of Forms and Reports might vary according to the host, or according to the host that was used to create them.
Ok, ..but we'll be looking for a Controls
collection. Isn't that member guaranteed to be present and implemented by the interface?
IIRC the accessibility of Access document-type components depends upon whether the document is open in design view, and perhaps, to a lesser extent, if the code module is open.
That is, I'm not sure that the controls collection is available, unless the form is open is design view. Opening a form/report into design view takes time...
Excel keeps worksheet ActiveX controls in the Worksheet Shapes collection. Word keeps ActiveX controls in the Document.Fields collection.
I don't think Access 2013 Forms or Reports have VBA Designers, or not as far as the VBIDE is aware.
Access can have standard UserForms, which do have Designers, but Access Forms and Reports do not return a DesignerID, and HasOpenDesigner is always false, regardless of whether the Form/Report is open in Access' design view.
The Properties collection of the vbComponent is unavailable if the Form/Report is closed, but is available if the Form/Report is in Design mode, which means you can retrieve the Controls collection from the properties, but only when the form is open in the Access UI.
The above didn't seem to vary by Access File Format version, but it might vary according to the version of Access.
I don't have MS-Access so I can't test this live - I'd rather move it to 2.1 than put something together that just blows up when it runs in an actual MS-Access environment.
MS-Access forms are document modules (as opposed to Excel forms, which are
UserForm
modules) and currently get picked up as such:When the host application is MS-Access and a document module's name starts with
Form_
, we need to inspect its designer to pick up the controls, like we do for UserForms.(ref. #827)