Results 1 to 2 of 2
  1. #1
    newwales is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Jun 2011
    Posts
    3

    Dlookup in query using Global variable

    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 enter the Price list, 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 Dose not Work Price: DLookUp([priceno],"pricelist",[tbl_code]=[pricelist]![code])

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

    Thanks.

    I have created a test database attached to show what I am doing.

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Price Dose not Work Price: DLookUp([priceno],"pricelist",[tbl_code]=[pricelist]![code])

    If you can help I would like Price to work as this should lookup the data in PriceNo field & then look in the Pricelist table for the corresponding column heading & then find the value.
    From what I see, you don't have a "priceno" field in the table "pricelist". Therefore, you cannot have a return value for the DLookup().

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Global Property Changes
    By ajetrumpet in forum Code Repository
    Replies: 2
    Last Post: 08-07-2012, 10:31 PM
  2. Help Using Variable in DLookup Statement
    By bcmarshall in forum Access
    Replies: 9
    Last Post: 12-02-2010, 12:44 AM
  3. Declare a Global Variable and Use it on Forms
    By jackkent in forum Access
    Replies: 9
    Last Post: 10-07-2010, 10:19 AM
  4. Help Please - Global Vars
    By graviz in forum Programming
    Replies: 3
    Last Post: 02-18-2010, 10:36 AM
  5. Macros for global search
    By joypanattil in forum Access
    Replies: 2
    Last Post: 11-28-2009, 04:30 AM

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
  •  
Other Forums: Microsoft Office Forums