Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2006
    Posts
    15

    Unanswered: Calculation in a form

    I have the following feilds on a form

    Name
    Animal Type
    No of Animals
    Amount

    What I want to do is have the "Amount" automatically calcute itself. I have 2 tables, one where all this data gets sent too and another table that contains the types of animals and how much each is worth. Once I have typed the name, animal type and no of animals in, when i then tab to the amount field I want this field to look up the animal table, match the type of animal and get the price of that animal and then times it by the no of animals entered on the current form. Now the easiest way I can think of this is to create a query to calculate this amount, that is no problem, but how do i then gets this figure back into the current form.

    Once this problem is solved is it possible then to have the information I typed on the screen printed out on a report without having to change screens. ie use the print command?

    Thanks in advance.

  2. #2
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Use a DLookup in the control source of a textbox on your form.

  3. #3
    Join Date
    Jul 2006
    Posts
    15
    I thought DLookup could only get data from another table. I need data from a query.

  4. #4
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Dlookup will work with a query as a well as a table. Seach for dlookup in Access help for details. If you use dlookup, you can hit the animal table directly to fill the textbox on your form.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •