Results 1 to 4 of 4
  1. #1
    Maxelkat is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    May 2011
    Posts
    2

    Can't get my Dlookup to work!

    I'm very inexperienced at Access and am hopelessly out of my depth - please help!

    This is my code:

    Expr1: DLookUp("[Hours Actual]","Hours - Actual Build Hours","[Cooler Design]=" & [Cooler Design])

    I am trying to 'Hours Actual' from the 'Hours - Actual Build Hours' table, where the 'Cooler Design' in that table matches the 'Cooler Design' in the current query.

    Instead it's asking me to 'Enter Parameter Value'. If I manually enter one of the possible values of 'Cooler Design', it returns with the corresponding value of 'Hours Actual' as taken from the 'Hours - Actual Build Hours' table, for all records in the current query (instead of comparing the 'Cooler Design' for each record with the corresponding value in the 'Hours - Actual build Hours' table).

    Hope this makes sense - if you need any more details, please let me know.

    Maxelkat

  2. #2
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Hi,
    Change the expression as:


    DLookUp("[Hours Actual]","[Hours - Actual Build Hours]","[Cooler Design]=" & [Cooler

    Design])

    Remember!!! there should always be [ ] around the fieldnames, tablesnames in the expression if they have <Spaces> in it.

    Hope this help!

  3. #3
    Maxelkat is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    May 2011
    Posts
    2
    Hi Khalid,

    Thanks for your help. I changed it, but the criteria part wasn't working either.
    My boss managed to get it to work by using relationships between the two instances of 'Cooler Design'. I don't fully understand how it works.
    Thanks anyway

    Maxelkat

  4. #4
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Hi,
    What error message you are getting? I am sorry for breaking the code line by mistake, it should be:
    DLookUp("[Hours Actual]","[Hours - Actual Build Hours]","[Cooler Design]=" & [CoolerDesign])
    What exactly you want to do? can you explain more clearly?

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

Similar Threads

  1. Is DLookUp What I should be using?
    By cameronaziz in forum Forms
    Replies: 2
    Last Post: 03-24-2011, 04:29 PM
  2. Would DLookup() work better here?
    By eww in forum Programming
    Replies: 2
    Last Post: 09-30-2010, 01:53 PM
  3. Need help with dlookup.
    By Keith in forum Database Design
    Replies: 8
    Last Post: 05-24-2010, 06:28 PM
  4. Replies: 2
    Last Post: 11-04-2009, 09:45 PM
  5. Replies: 1
    Last Post: 01-10-2006, 12:32 PM

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