none
Pathing for Sub-form inbeded in a Tab Control RRS feed

  • Question

  • I am trying to delete a record from a multi record sub-form that was added to a Tab control via vba but I am not sure how to reference a  sub-form yet alone a sub-form in a Tab control. 

    The Parent Form is: "Applicants"

    Tab Control: "Tab_More"

    Sub Form: "Skills"

    Any examples would be much appreciated. 

    Monday, February 6, 2017 2:05 PM

Answers

  • The subform should have a Name. Use Me.SUBFORMNAME.Form to get a reference to the form within that control. InteliSense doesn't work usually, so make sure your code is correct. Like if the PK on the child form is a CustomerId you can use: Me.Child0.Form.txtCustomerId or Me.Child0.Form.Recordset.Fields("CustomerId").Value to get the PK on the record where the cursor is currently at on the Multi record subform.
    • Marked as answer by Nidant Monday, February 6, 2017 2:29 PM
    Monday, February 6, 2017 2:25 PM

All replies

  • The subform should have a Name. Use Me.SUBFORMNAME.Form to get a reference to the form within that control. InteliSense doesn't work usually, so make sure your code is correct. Like if the PK on the child form is a CustomerId you can use: Me.Child0.Form.txtCustomerId or Me.Child0.Form.Recordset.Fields("CustomerId").Value to get the PK on the record where the cursor is currently at on the Multi record subform.
    • Marked as answer by Nidant Monday, February 6, 2017 2:29 PM
    Monday, February 6, 2017 2:25 PM
  • Thanks HTHP that is exactly what I needed.
    Monday, February 6, 2017 2:29 PM