Results 1 to 7 of 7
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    referring to a subform in code (2000)

    Question 2 of the day! Is it possible to refer to a value in a subform? I have frmTimeSheet with sfrmBilling in it. I would like [Bill_Rate] to = [Contract_Rate]. [Bill_Rate] is on frmTimesheet and [Contract_Rate] is on sfrmBilling. I'm not sure if its possible and if so how to code it.

    Thanks,
    Leesha

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: referring to a subform in code (2000)

    If sfrmBilling is the name of the subform as a control on frmTimesheet, you can use

    =[sfrmBilling]![Contract_Rate]

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: referring to a subform in code (2000)

    Hi Hans!

    Thanks for the quick response. frmBilling is a control on sfrmTimeSheet. sfrmTimesheet is a control on frmEmployee. I put in the following code:
    Me.Bill_Rate = [sfrmBilling]![Contract_Rate]
    and get the followoing error --- ...can't find field contract rate referred to in the expression.......

    Leesha

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: referring to a subform in code (2000)

    Try Me.Bill_Rate = [sfrmBilling].Form.[Contract_Rate] instead. If that doesn't work either, check carefully what the exact name of the contract rate is.

  5. #5
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: referring to a subform in code (2000)

    That did it!!!! Thanks soooooo much.

    Leesha

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: referring to a subform in code (2000)

    Leesha,

    Refer to Form and Subform properties and controls on Dev Ashish's Access Web contains a comprehensive overview.

  7. #7
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: referring to a subform in code (2000)

    Will do. I appreciate the link/help.

    Leesha

Posting Permissions

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