Results 1 to 5 of 5
  1. #1
    CalifDan is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    2

    Dlookup problem

    I am trying to place a particular field in an unbound text box in the summary section of a report.

    The report is bound to a query which properly returns the values to run the report. The database and report tracks the gifting of properties.

    The relevant fields in the Gift_Table are:

    Gift_PropertyValue
    Giftee
    Gift_Year
    Gift_PropertyAddress



    I want to put the last years Gift_PropertyValue in the unbound control for purposes of comparison and to carry out some calculations in other fields. I am using the following Dlookup with some variations.

    DLookUp("[Gift_PropertyValue]","[Gift_Table]","[Gift_Table]![Gift_Property]='property address' AND [Gift_table].[Gift_Year]='2009' and [Gift_Table]![Giftee] = 'giftee name'")

    With this one I get a null response. With some variations I either get error or the first record matching Gift_Property and Giftee but ignoring the year.

    I am missing something. Any help?

    Thanks. CalifDan

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Don't scope the fields!
    DLookUp("[Gift_PropertyValue]","[Gift_Table]","[Gift_Property]='property address' AND [Gift_Year]='2009' and [Giftee] = 'giftee name'")
    http://www.mvps.org/access/general/gen0018.htm

  3. #3
    CalifDan is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    2
    This is one of the variations I have tried. I put it in exactly as indicated (I beleive) and the record definitely exists. I checked each criteria specified against the actual field in the record. I am getting a null response....no record.

    What else could it be?

    CalifDan

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Is Gift_Year a number or a string? Is it a DateTime field?

  5. #5
    SoftwareMatters is offline Access VBA Developers
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    This maybe just a typo but in your list you have Gift_PropertyAddress and in your DLookup you have [Gift_Property]

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

Similar Threads

  1. dlookup versus SQL value search
    By marianne in forum Access
    Replies: 3
    Last Post: 07-15-2009, 09:23 AM
  2. Dlookup
    By janjan_376 in forum Access
    Replies: 20
    Last Post: 07-07-2009, 07:40 AM
  3. Dlookup question
    By nkenney in forum Forms
    Replies: 3
    Last Post: 07-01-2009, 06:36 PM
  4. I have Problem in processing Dlookup Function
    By Katada in forum Programming
    Replies: 2
    Last Post: 04-23-2006, 12:07 AM
  5. Need Help for Dlookup function
    By wasim_sono in forum Programming
    Replies: 5
    Last Post: 01-04-2006, 08:18 AM

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