On Open Event

  • Thread starter Thread starter NEWER USER
  • Start date Start date
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.
 
Because the full syntax should be:

Forms.frmCategories.fsubCategoryDetails.Form.Sales.ColumnHidden = 0
 
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.
 
Back
Top