Results 1 to 3 of 3
  1. #1
    Join Date
    May 2011

    Unanswered: Dlookup in Query

    I have a query that I am trying to do a Dlookup on that will lookup a field in the same query called CostsetNo which contains the current data of C97, I am using this to to lookup a value in the C97 field on Costset table, I have attached picture to explain more.

    The below formula returnes only first number in the C97 field for every record
    Totalcost: DLookUp([costsetno],"CostSet",[Resource_Code])

    The below Formulas works & retunes different values for every record
    Totalcost2: DLookUp([c97],"CostSet",[Resource_Code])

    I think it maybe missing “ but not sure. I an doing this so that I can change the value in the Costsetno & then the Dlookup should lookup the values in the correct Field header on Costset.

    Hope someone can help
    Attached Thumbnails Attached Thumbnails Query Dlookup1.jpg   Query Dlookup2.jpg  

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    why not 'just' join to the costset table and pull the value as required
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    May 2011
    They are linked all ready, the Costsetno contains a global variable that changes so I need the dlookup to look in Costsetno & use this value to choose the correct field in Costset table.

    Dlookup in query problem think it is to do with placement of “ or [ but not to sure.

    I have a form “FRM_Data” within this form I have some data & a text box to display the tbl price, when you enter data into the Price list text box the data is stores as a global value “GL_Selected_Pricelist”

    In Qry_data there is a field PriceNo that displayes the “GL_Selected_Pricelist” & a 2 Dlookup field.

    Priceb is the one that works Priceb: DLookUp([price1],"pricelist",[tbl_code]=pricelist!code)

    Price Dos not Work Price: DLookUp([priceno],"pricelist",[tbl_code]=[pricelist]![code])

    If you can help I would like Price to work as this should looup the data in PriceNo field & then look in the Pricelist table for the corresponding column heading & then find the value.

    Last edited by Newwales; 06-01-11 at 08:42.

Tags for this Thread

Posting Permissions

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