Trouble referring to a Control

  • Thread starter Thread starter RobUCSD via AccessMonster.com
  • Start date Start date
R

RobUCSD via AccessMonster.com

With the below I'm trying to requery a txtBox control that counts the number
of entries on a form. I get
Error 2465 cant't find field fsubACTcount.

Forms!frmACT.Form!fsubACT.Form!fsubACTcount.Form!txtACTcount.Requery

MainForm=frmACT, fsubACT has the field fldACT that has the afterUpdate event
in it, fsubACTcount has the control txtACTcount that needs to be updated.

Thanks in advance for your help. Rob
 
Waht is your from/subform setup?

The code you are using suggests that you have a form (frmACT) that has a
subform (fsubACT) and this subform has a subform (fsubACTcount ).

If fsubACTcount is a subform of frmACT then you need:
Forms!frmACT!fsubACTcount.Form.Requery

If you are calling this code in the frmACT form, you can use:
Me!fsubACTcount.Form.Requery

Steve
 
RobUCSD said:
With the below I'm trying to requery a txtBox control that counts the number
of entries on a form. I get
Error 2465 cant't find field fsubACTcount.

Forms!frmACT.Form!fsubACT.Form!fsubACTcount.Form!txtACTcount.Requery

MainForm=frmACT, fsubACT has the field fldACT that has the afterUpdate event
in it, fsubACTcount has the control txtACTcount that needs to be updated.


That message usually means that you used the name of the
form object instead of the name of the subform ***control***
that is used to display the form (as a subform).

You can shorten that reference from the subform to the
subsubform a little:

Me.fsubACT.Form!subformcontrolname.Form!txtACTcount.Requery

I don't know what the txtACTcount text box is calulating,
but if it's the number of records in the subsubform, then
using the expression =Count(*) should recalculate
automatically.
 
Back
Top