Calculations

RussG

Registered User.
Local time
Today, 21:35
Joined
Feb 10, 2001
Messages
178
Not sure of the best place to post this.....anyway here it is.

I need to do some calculations on a form but also want the calc available in the query so I can build a report.

What I need is the value in one field (i.e. age 15) to lookup a corresponding value in another table and do a calculation, the result is then used to calcuate another field which will also ref the other table to get the corresponding value to calculate.....and so on, I have 3 - 4 calculations to do.

Can this be done with query expressions or is an If statement the best way?

Would something like this work
If txtBox1 = 15 then * 1.25 else
If txtBox1 = 16 then * 1.5 etc
(I have values 1 - 17 to do calculations on.)

Not sure of the exact syntax but you get the idea. Hope this makes sense.
Would be grateful for any advice.
Thanks
RussG
 
tried Dlookup?

Code:
stTemp = DLookup("LocationName", "[tblLocation]","[LocationID]=" & lnLocationID)

look up a table called tbllocation and return the value of LocationName where the LocationID = lnLocationID

or use sql - i'll need more info to help further
 
Thanks for the reply - looks a lot less messy, I will give it a go and come back if I need more help.
RussG
 

Users who are viewing this thread

Back
Top Bottom