Post Data from one Sub From to another Sub form

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

I have a main form that contains 2 sub forms.

I have button on SubForm2 that I have programmed the On Click command to copy
data from Fld1 in this form to Fld1 in SubForm1.

CODE Example:
Private Sub copy_Click()

Forms!MainForm!SubForm1.Form!Fld1 = Forms!MainForm!SubForm2.Form!Fld1

End Sub

When I run it I get a message that says it cant find SubForm1 refereed to in
expression.

Any help would be very appreciated.

Matt
 
R

RuralGuy

I have a main form that contains 2 sub forms.

I have button on SubForm2 that I have programmed the On Click command to copy
data from Fld1 in this form to Fld1 in SubForm1.

CODE Example:
Private Sub copy_Click()

Forms!MainForm!SubForm1.Form!Fld1 = Forms!MainForm!SubForm2.Form!Fld1

End Sub

When I run it I get a message that says it cant find SubForm1 refereed to in
expression.

Any help would be very appreciated.

Matt

Make sure you are using the SubFormControlName (SubForm1 & SubForm2). This
usually defaults to the name of the form it is displaying but it is not a
requirement. I usually change the SubFormControlName just to make sure I know
what I'm referencing. You know you are looking at the SubFormControl when you
see the LinkChild/MasterFields on the data tab of the property sheet.
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 

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