calculating a discount on a form

matorme

Registered User.
Local time
Today, 11:06
Joined
Apr 11, 2008
Messages
17
hey,

at the moment i have my total showing on my form but i need to take 10% of this IF the order is over £30. So what i would have is a sub total which for the most part will show the same as the total EXCEPT when the sub total is over £30..then the total would show the 10% discount.

Its prob just something in a txt box on the form but i cant figure out what syntax.
Any help will be great, thanks :D
 
if subtotal=>30.00 then
total = subtotal*(90/100) or subtotal*.9
else
total=subtotal
something along these lines

doing this properly I would have a discount field on your form (and underlying table)
this would be
subtotal
discount
total

then if statment if subtot =>30.00 then discount = 10% of subtotal

then just minus discount off subtotal

this would alos allow you to overwrite discount or apply one when required- slightly longer - but more flexible
 
yeah i see where ya goin with that, havin the discount on the form so the total will take the value from that txt box. k thanks for ya help.
 
not havin much luck..see i know it needs to be an IIF command on the lines of:
if subtotal>30.00 then total=subtotal*0.9
if subtotal=<30.00 then total=subtotal

but i'm terrible at coding and i dont know how to put that into a way the computer understands it lol..and where to put it..
 
answering my own thread lol...got it working :D
i put this into the control source for my total:-

=IIf([OrderTotal]>30,[OrderTotal]*0.9,[OrderTotal])

I then 'hid' the OrderTotal field and just used this one as the order total. So if the order does go above £30 then the order total will show this.

((I understand that in a full business it wud be fitting to be able to change this discount amount, but my 'end user' for this assignment says it wont change..so way make more work for myself lol))
 

Users who are viewing this thread

Back
Top Bottom