Larry,
I renammed the subform "Child1" and still have the same problem.
I have always used the naming convention of naming a subform "Child"
and the second subform Child2, etc. It has been a big help in
simplifying code, such as allowing me to create generic code for
changing control attributes and the like.
I realized this problem went even deeper. In this user environment
there are two machines running Access2002 and this happens only on one
machine! Both are running Windows2000.
I am completely baffled.
When I go to the culprit machine, I installed this subform as a
continuous form (instead of a datasheet) which allowed me to see the
sum control ctlMySum in the subform's form footer containing the
controlsource "=Sum([Amount])"
On the offending machine, this control is blank! So the control on the
Parent form that has the controlsource
"=Forms!FormName.CHild.Form.ctlMySum" returns an error. However, on all
other machines it's fine.
lq
Larry Linson wrote:
"Bruno Campanini" wrote
> > I am using a control MyTotal on a subform
> > footer to get a sum of all rows on the subform:
> > =Sum([Amount])
> > On the main form I have a control whose
> > controlsource is:
> > =Forms!FormName.Child.Form.MyTotal.
> > This displays the sum of the subform.
> > It works fine on Access 2000 but displays
> > an error in Access 2002. I
> > can't figure this one out.
> > lq >
> It should be = Me . [MySubForm] . Form ! [MyTotal]
>
> Do you really use "Child" as the name for your subform?
> May be "Child" is a reseved word for Access 2002.
>
> Bruno
A form could have two SubForm controls at the same level -- which one
would be the "Child"? I don't have Access 2000 handy to try, but I would
expect it to give some kind of error. "Parent", on the other hand, is
unambigous.
Larry Linson
Microsoft Access MVP