Default value = math calculation

bazzanoid

Registered User.
Local time
Today, 03:41
Joined
Aug 30, 2008
Messages
35
Afternoon all,

I'm making good headway on sorting out everything that needs sorting ( had a fight with some reports and duplicate field names, sorted that out after a few hours piddling around.....:o)..

One of my forms has a cost field in it, and i want this to be automatic. not a problem, just stick in a default value. I'm having trouble with building the calculation though!!! Here's what I want:

= (£3.20 x ChildrenNumber) unless total is less than £70.00, then cost = £70.00

If you see what I mean!

Thanks in advance for a really simple question!!!!
 
Us an IIF

IIF( (£3.20 x ChildrenNumber) < 70; 70; (£3.20 x ChildrenNumber) )

Good luck !
 
Tried this, doesn't seem to work!!! Just leaves the field blank, perhaps i'm doing something wrong? Set the default value to
Code:
=IIf((3.2*[ChildrenNumber])<70,70,(3.2*[ChildrenNumber]))

Using Access2007, not sure if it makes any odds.
 
Just tried this in the immediate window

iif(3.2*5<70,70,3.2*5)

and it worked

Simply substitute the 5 for number of children.
 

Users who are viewing this thread

Back
Top Bottom