Macros update in a subform

E

Elena Kuo

I have a form where I put in one date and it automatically generates a date
for follo up 6 momnths later in a nother field. The form works perfectly on
its own. When I put it in a subform, it says it can't find the form and
won't run the macros. Anyone have any ideas why this would be?
 
J

John Vinson

I have a form where I put in one date and it automatically generates a date
for follo up 6 momnths later in a nother field. The form works perfectly on
its own. When I put it in a subform, it says it can't find the form and
won't run the macros. Anyone have any ideas why this would be?

It's probably because your macros are explicitly referring to the form
name (in the syntax Forms!formname!controlname for example).

A Form that is being used as a Subform is not open in its own right,
and is not a member of the Forms collection. To refer to a control on
a Subform, you need the Name property of the Subform Control on the
mainform (which may be the same or different than the name of the form
within that control):

Forms!mainform!subformcontrol.Form!textboxname

If you'ld care to post your code or the definition of the macro -
which is the source of the problem and which we cannot see - someone
should be able to help.

John W. Vinson[MVP]
 
Top