After Update event on form inputting data into a subform?

W

WildlyHarry

I have a form with a subform. I want to set the After Update field for the
form to populate data into a field on a subform. The form is linked to one
table, the subform is linked to a different table. I would typically use
code like:

After Update

me.field1.value = "MONKEYS"

However, I cannot find the reference for the field on the subform. Any
suggestions? Thanks in advance for the help.
 
K

Keven Denen

I have a form with a subform.  I want to set the After Update field forthe
form to populate data into a field on a subform.  The form is linked toone
table, the subform is linked to a different table.  I would typically use
code like:

After Update

me.field1.value = "MONKEYS"

However, I cannot find the reference for the field on the subform.  Any
suggestions?  Thanks in advance for the help.

To reference a field in the subform, use this structure: Forms!
MainFormName!SubFormName!Control

Keven Denen
 
J

John W. Vinson

I have a form with a subform. I want to set the After Update field for the
form to populate data into a field on a subform. The form is linked to one
table, the subform is linked to a different table. I would typically use
code like:

After Update

me.field1.value = "MONKEYS"

However, I cannot find the reference for the field on the subform. Any
suggestions? Thanks in advance for the help.

Try

Me!subformname.Form!controlname =

Note that this will insert into whichever record is currently active on the
subform, and from the mainform, you can't necessarily control or tell which
record that might be; it sounds like a rather dangerous thing to do!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top