Filter Trouble

Dear All,

i have 15 fields in a table. the 15th field is total

i need to set the Total as

total = ( ( field1 + field 2 +…field 14) / 8 )

Please can any guide me in this:)

thanks:)

Hi Shona,

You can put your function on OnValidate of each field (1…14). But why would you need this??

Regards,

-TR-

Are you suggesting that i create an Global value Total and add the fields and paste the same code in all CAL of the fields?

i need to calculate the total for my table thats why i need it.

Thanks:)

Are you suggesting that i create an Global value Total and add the fields and paste the same code in all CAL of the fields?

i need to calculate the total for my table thats why i need it.

Thanks:)

sorry some default message said my post As not been posted so posted the same again.

thanks:)

You mean Global Variable?? Not necessarily.

I’m afraid so.

I was just wondering why don’t you use a form or report to get the total of your table. If you do this, you will only create a function once and assign it as your SourceExpr(ession)

Regards,

-TR-

thanks:)

1. Create a form (List or Card whichever you prefer), I will use list
2. Add all the fields (1 to 14) to the form
3. Create a function Total with a Decimal return value. Put the summation in this function, don’t forget to return a value _use EXIT
4. Add one Text box and put Total as the SourceExpr
5. There you have it [:D]

6470.tot.bmp (2.25 MB)

oh i have created a list form and have 15 fields. since its like i want the total of each row. so cant use the text box right? i have a field called total like this.

But have you tried this??

yes i changed the one i previously created as you said! stil i cant seem to get the result.

Total () :Decimal

l_Total ==> Local Var

l_Total := 1 + 2 + 3 + …+14; //This 1 2 3 referring to your Field Name

EXIT(l_Total)

Regards,

-TR-

hey tony thank for all your help. have solved my trouble.

Instead of Rec.field i was using xRec.field. that was the problem:)

oh i just used the fields name its like this.

Field15 := ((field 1 + …+field 14 ) / 8)

but thanks:)