Referring to a control in the subform footer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • csolomon
    New Member
    • Mar 2008
    • 166

    Referring to a control in the subform footer

    Hello:

    I would like to use information on one form to populate another form. There are 2 controls I would like to transfer; a list box control and a text box control. both are unbound controls in the subform footer of the form F_MixDesign.
    Form1: F_MixDesign
    Subform1: SF_MixSample
    Control name: txtWaterReqWt

    Form2:FSampleRe quest
    Subform2: SF_SampleReques t
    Control name: txtWater

    Both the control I would like to copy and the control that will be copied to are in the subform footers.

    I have a button on form1 that when clicked will open form2. Here is my code, but I know it's wrong because it doesn't work.

    Private Sub btnOpenSampReq_ Click()

    DoCmd.OpenForm "F_SampleReques t"
    'Open F_Sample Request

    Forms!F_SampleR equest.Controls !txtWater = Forms!F_MixDesi gn.Controls!Lis tWater
    Forms!F_SampleR equest.Controls !txtWatReqWt = Forms!F_MixDesi gn.Controls!txt WaterReqWt
    End Sub

    I have also tried using:
    Me!SF_SampleReq uest.Controls!t xtWater = Me!SF_MixDesign .Controls!ListW ater
  • ChipR
    Recognized Expert Top Contributor
    • Jul 2008
    • 1289

    #2
    From here:
    Forms: Refer to Form and Subform properties and controls

    Forms!Mainform! Subform1.Form!C ontrolName = Me!Subform1.For m!ControlName

    so

    Forms!FSampleRe quest!SF_Sample Request.Form!tx tWater = SF_MixSample.Fo rm!txtWaterReqW t

    Comment

    • csolomon
      New Member
      • Mar 2008
      • 166

      #3
      Chip,

      You are wonderful! Thank you.

      I tried to use that reference initially, but I can't understand it really...thank you

      Comment

      Working...