Results 1 to 5 of 5
  1. #1
    Tiffer is offline Novice
    Windows XP Access 97
    Join Date
    Mar 2010
    Posts
    2

    Red face Calculated field using DLookup from query not updating

    I have an unbound text box in a form where I need to look up a value from a query called qry_Fees to obtain the value in the field [SumOfFee] where the field [Picture Index] in the query is the same as the field [PictureIndex] in the form and am using the DLookUp formula below



    DLookUp("[qry_Fees]![SumOfFee] ","qry_Fees"," [qry_Fees]![PictureIndex] = [PictureIndex]&quot

    When the form is opened the value is correct for the first record, but when I scroll through the records it remains the same. I have read numerous threads and have not found a solution. I have tried putting code to both refresh the query (which I don't be lieve is necessary) and recalculate the form, but may not have put them in the right place.
    My questions are:
    1. Is there a problem with my syntax for the DlookUp
    2. Where should I put any code so that the field updates as the records are scrolled through
    3. What code should I useI have been trying to solve this for ages, so any help would be really appreciated.

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Let me get you straight you want to lookup a value in a query and display the same on a unbound textbox on a from.

    Type this code on the ControlSource of your text box.

    Dlookup("[SumOfFee]","qry_fees","[Picture Index]="&Forms!Name of Your Form!Picture Index)

    This will solve your problem.

    If your are able to solve your problem please mark this thread solved.

  3. #3
    Tiffer is offline Novice
    Windows XP Access 97
    Join Date
    Mar 2010
    Posts
    2
    MaximusMany thanks. I was still having problems, until I closed the Database down and restarted. It now worksHow do I post the thread as solved?

  4. #4
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    https://www.accessforums.net/forum-s...lved-1828.html
    Follow this link and learn how to mark this thread solved. marking threads solved wil help somebody having a similar problem later. Thanx that I could help

  5. #5
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Please mark the thread solved follwo the link and learn how to do it. Basically go to thread tools and mark it solved.

    Thanx

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

Similar Threads

  1. Calculated Field in continuous form
    By doobybug in forum Forms
    Replies: 2
    Last Post: 11-15-2009, 08:54 AM
  2. Replies: 1
    Last Post: 02-05-2009, 04:53 PM
  3. Calculated Query Field used in different Query
    By cakdhooper in forum Queries
    Replies: 0
    Last Post: 11-21-2008, 03:07 PM
  4. Setting criteria in a calculated date field
    By SteveReberger in forum Access
    Replies: 0
    Last Post: 10-29-2008, 06:58 AM
  5. Update table from calculated field in a form
    By BernardKane in forum Forms
    Replies: 3
    Last Post: 11-28-2006, 09:48 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