Max. # of Controls on Form

  • Thread starter Thread starter BGates
  • Start date Start date
B

BGates

Have a form with three subforms, over 100 controls in all.
Under certain conditions, some of the controls
on one of the subforms should not be enabled.
The code works, setting the controls.enabled = false up to
the last five (of 30) controls. Error message is
"Database can't find the field 'txtCompleteDate' referred
to in your expression", even though I can see the control
on the subform.
Does Access just run out of steam and can't manage the
refresh of all those controls?
 
Hi

I would start with a Repair / Compact of the database.

Number of controls and sections you can add over the lifetime of the form or
report is 754

Maurice
 
Possibly there is something corrupt in the form, at 100 you are well within
the allowable number. Also, assuming it works for forms as it does for
reports (I've hit the limit in reports), using a subform only counts as one
control on the form holding the subform.

Check for typos in the name of the control or the name used in the code.
Also, make sure the control and the field it is bound to don't have the same
name. If the field is FieldName then change the textbox to txtFieldName and
use the name of the control in the code.

Since you appear to mention that this works for some of your controlls, I
assume you have the syntax correct to refer to controls on a subform from a
main form, but just in case:

Me.ctlNameOfSubformControl.Form!ctlNameOfControl

The ctlNameOfSubformControl is the name of a control on the main form that
holds the subform, not the name of the subform. To see this name, open the
main form in design mode, open the Properties sheet, and click on the
subform ONE time. The Properties sheet should show the name of the subform
control. If you click more than once, you'll be in the subform and the
Properties sheet will show the name of the subform, not the control holding
it.
 
Back
Top