IF THEN Statements

Ashkan

Registered User.
Local time
Tomorrow, 09:39
Joined
Oct 19, 2004
Messages
14
Hello,

I am making a small DB in Access to track my Ebay sales. I have a table with a SoldItems field. I want to make a report that will calculate the Final Value Fees so I don't have to enter it my self.

If the Final Sale price of an item is between $0 and $75 then I will be charged 5.25%. $75 to $1000 I will be charged 5.25% up to $75 and 2.25% for the rest.

I can't get it to work. This is all I have done so far:

If [SoldPrice] < 75 Then [FinalValue] = [SoldPrice]*1.052

Thanks
 
I would do this in a function as you may need it it several places.
 
how would i do a function

i am new to access
 
Never mind. Where are you trying to put your code that calculates the charges?
 
in a report, i am trying to do it in the control source
 
I must have missed something here 5.25% of 1000 is 52.5 so when does the rate change? ie when does the fee become greater than $75

Brian
 
In the control source for the text box on the report, you can do something like:

= iif([SoldPrice]<=75, [SoldPrice] *1.0525, iif(([SoldPrice] > 75) and ([SoldPrice] < 1000 , [SoldPrice] *1.0325, [SoldPrice] *1.0225

I have not tested it but it should work. Basically, you just embed iif statements...

Here is a mdb with a simple fuction where the function is used in a query and in a form. Poke around with it and see if you can figure out how it's working...
 

Attachments

if the final price of the item is less than $75, then there is a 5.25% fee. if the item sells for more than $75 then the fee is calcauted by charging 5.25% for the first $75 and 2.25% for the reminder

could you please give me the code required to calculate this?
 
= iif([SoldPrice]<=75, [SoldPrice] *1.0525, (([SoldPrice]-75) * 1.0225) + 3.94))

???
 
Last edited:
I'm having terrible performance problems communicating with this site I'm giving up

Brian
 
Last edited:
I would do it in the query but wherever you do it

finalcost: IIf([soldprice]>75,(soldprice+([soldprice]*0.0525)+(([soldprice]-75)*0.0255)),[soldprice]*1.0525)

Brian
 

Users who are viewing this thread

Back
Top Bottom