Add Sum to an item (see file)

Posted on 2011-10-07
Last Modified: 2012-08-14
Hello guys

In a formular, frmCourseMain, I just want to add a textbox (SUM in red in the file) which contains the sum of the fees of the student registered for the course chosen.
I made a simple request  SumFeesOfCourse, and I dont know how to link this with the textbox in order to screen a correct result.
I think my understanding of how to link is not proper...

Thanks in advance for explanation!

Question by:Noero
    LVL 61

    Expert Comment

    You can't "link" directly to your query in the control source of your textbox.  You need to lookup the value.

    This will give you the sum for the CourseID of the current record on your main form:

    =DLookUp("SommeDeFees","SumFeesForCourse","CourseID = " & [CourseID])
    LVL 61

    Accepted Solution

    There's good relevant information and explanations by Jim Dettman in his article on DLookup and the Domain Functions here:

    (if the article is helpful to you, vote 'yes' on it)

    Author Comment

    Quick, Clear, Efficient: Thank you!

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now