Results 1 to 8 of 8
  1. #1
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402

    Dlookup Problem

    Hi All



    i am struggling to get my head around Dlookups and Dsum so im really sorry to be asking another question on this subject.

    i have a form called "List of customer orders" that ineed to show the "amount left to pay" from the Edit orders form in a text field called "Outstanding Amount"

    "Amount left to pay" is an unbound text field

    the problem is i can't work out the syntax for the Dlookup

    this is what i have been using with no luck!!

    me.Outstanding_Amount =DLookUp("[OrderID]","[Orders]","CustomerID=" & "[Forms].[Edt Orders].[Amount_Left_To_Pay_TXT_Box]")

    i have also tried to use this

    Forms![Edit Orders]![Amount_Left_To_Pay_TXT_Box] on it's own but no luck.

    the edit orders form is not open as i want the "List of Customer Orders" form to show me how much has been paid from each customer order, without me having to open each one up individually.

    once again im sorry if this is very similar to previous questions.

    many thanks

    Steve

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    This should help:

    DLookup Usage Samples
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    Hi Paul

    Many Thanks for the link.

    i may have been abit silly here

    im not sure that i can use a dlookup because the value im looking for is not held in a table, its calculated in the fly on the edit orders form, i need to see the value of the "amount left to pay" field " that is unbound and show that on the "List of customer orders form".

    is this something that dlookup can do?

    i find all this really confusing lol

    Steve

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    No, it can't. You should be able to refer to the form control from elsewhere in the db, as long as it's open.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    Hi

    What Happens if the form is not open, is there a way to get he value?

    Steve

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    No; you'd have to recreate the calculation.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    Hi Paul

    Many Thanks

    Steve

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    No problem Steve.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Dlookup problem
    By Terava in forum Access
    Replies: 5
    Last Post: 04-29-2013, 11:05 PM
  2. VBA DlookUp problem
    By luli in forum Programming
    Replies: 1
    Last Post: 01-06-2013, 09:32 PM
  3. DLookup Problem
    By alsoto in forum Queries
    Replies: 5
    Last Post: 02-23-2012, 12:22 PM
  4. Problem with DLookup
    By MichealShinn in forum Programming
    Replies: 5
    Last Post: 01-25-2012, 09:08 AM
  5. Dlookup problem
    By metronometro in forum Queries
    Replies: 1
    Last Post: 01-07-2012, 12:17 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