On Open Event

N

NEWER USER

I get an error message On Open - Object does not support this method or
property.

I have it narrowed down to:
Forms.frmCategories.fsubCategoryDetails.Sales.ColumnHidden = 0

To open without the error, I replaced a period with an exclamation point.
Forms.frmCategories.fsubCategoryDetails!Sales.ColumnHidden = 0

Why will a period NOT work in this case? Any help appreciated.
 
A

Arvin Meyer [MVP]

Because the full syntax should be:

Forms.frmCategories.fsubCategoryDetails.Form.Sales.ColumnHidden = 0
 
K

Klatuu

No, it has to do with how you address subform controls.

When you address a subform, you do not use the name of the form being used
as the subform. You use the name of the subform control on the main form.
The form being used as a subform is the Source Object property of the subform
control. So the syntax to reference a control on a sub form is:

Forms!FormName!subformControlName.Form!ControlName

You use the period instead of the exclamation because Form is a property of
the subform control, not a named object.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top