Can't build right formula

egidijus.jankauskas

New member
Local time
Today, 16:42
Joined
Feb 22, 2011
Messages
9
Hi,
could you please tell me how tu build Formula1 and Formula2 (look in picture). It's already third day when I am trying to do this, but ussally the reslut is the same " enter parameter value" or error, or nothing. Thank you in advance.
 

Attachments

  • reported.jpg
    reported.jpg
    16.3 KB · Views: 112
Basically you can't Sum() calculated values in controls. If you put the calculation in the Record Source of the form, i.e. the query behind the form, then you can Sum on that alias field.

For example, in a new column in the query, for TCS you will put this:
Code:
TCS: [Percent] * [Transportation Costs]

In the Control Source of the TCS textbox select TCS.

Finally, you can now put =Sum([TCS]) in the footer to get a sum.
 
Then appears another problem, how to group a data in Query (picture attached)? And group should be done by name and by Invoice No, that I could use these calculations in my report. Consequently 1 and 2 row should appear as sum as it is the same Product (Name) and the same invoice. How to summ [Weight] field separated by Invoices? I have done this in a Form, but I can't use calculated fields in form as well for my report.
 

Attachments

  • table.JPG
    table.JPG
    70.8 KB · Views: 93
Last edited:
So now I have two queries. One for separate records, another for totals. And if I want to calculate percentage of total [Weight] by additional record in field [POTC] I have to enter a formula "POTC: [Weight]/[Receiving Query1]![Sum Of Weight]" but the result is "Enter parameter value"
 

Attachments

Thank you vbaInet IT seems that I succesfully have build a formula. But it is left one more unclear point. Please look at picture attached. Last row shows strange number 342,38 % when it shoul be aprox 85 %(179.750/210.633).
Formula is:
POTC: [Weight]/DLookUp("[Sum Of Weight]";"[Receiving Query1]")
 

Attachments

  • table.JPG
    table.JPG
    32 KB · Views: 89
You're missing the third part of the DLookup() function which will link it to that current record. E.g.:

DLookup("field", "table", "id = " & [id])
 

Users who are viewing this thread

Back
Top Bottom