Results 1 to 3 of 3

Thread: subform

  1. #1
    Join Date
    Apr 2004

    Unanswered: subform


    if anyone can assist me. not a big access programmer, but know basic, as well vb too.

    i was wondering, would it be possible to use dlookup function in order to get value from subfrom. i have combo box, and couple subforms. everytime, i change value in combo box, it updates my two subforms. in main form, i have text controls, and i wanted to find out, is anyway, i can use dlookup formula to get values from subfrom based on descriptions.

    for example,

    txtdata1 should get me value (dollar amount) based on condo prices. (please note that condo price description, could be 4th line or 5th, i mean to say it could vary based on combo fild)

    texdata2 should get me value (dollar amount) based on projected prices.

    would appreciate your help. i mean, i could create a button to run create table query and get value. but if i can can use subform in dlookup formula, that would be awesome.



  2. #2
    Join Date
    Feb 2004
    to reference a control value in a sub form use the following syntax


    If this is the value you need then set the controlsource property using the above reference using your form names

    FYI for a subform control to reference a control in the main form use

  3. #3
    Join Date
    Apr 2004
    thanks KC.

    however my point was with that code, i am unable to retrive data that i was looking for. i have used following command to get data.

    Text114.Value = DLookup("[ytd actual]", stactual, "[Account Descriptions]=" & "'BONUS -INCENTIVE'")

    If IsNull(Text114.Value) Then
    Text114.Value = "$0.00"
    End If

    though, i have one more problem. i have text box, which sums up all the top values from above textboxes. my sumtext box gives me an error saying type mismatch, also it shows value $0.00$0.00 in a filed. would appreciate thoughts on 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