Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Location
    UK
    Posts
    233

    Unanswered: Variable from a subform

    I am trying to store data from a subform into a variable. The following codes shows what I have so far.

    The first to variables work fine that are looking at the main form the next variable creates an error. "Object dosent support this property or method". MyCostID that is looking at the subform.

    Private Sub Form_Open(Cancel As Integer)
    Dim MyInvoice As String
    Dim MyAccRef As Variant
    Dim MyLineNo As Variant
    Dim MyCostID As Variant

    'store variables
    MyAccRef = Forms.frmCostAllocation.txtAccounts_Reference
    MyLineNo = Forms.frmCostAllocation.txtAccounts_Line_No
    MyCostID = Forms.frmCostAllocationsub.txtCostID

    All help appreciated.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    The syntax to refer to a subform is different:

    http://www.mvps.org/access/forms/frm0031.htm
    Paul

  3. #3
    Join Date
    May 2003
    Location
    UK
    Posts
    233
    That is excellent - Cheers for that!
    ! or is it .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •