Help with an IIF statement

knothed

New member
Local time
Today, 23:24
Joined
Dec 8, 2000
Messages
6
I have a control on my form which references a mileage figure in my table. I have another control that figures freight based on that mileage figure ie =miles*freight rate. But a different rule applies if the mileage figure is under 100 miles. I need to write an IIF statement to make this control work properly.Any help will be greatly appreciated
 
Use an event

sub miles_field_after_update ()
if [miles] < 100 Then
[cost] = miles * rate for under 100
else
[cost] = miles * rate for over 100
end if
end sub

You could also use the iif statement if
it is query based. Create a calculated field in the query.

FieldName: IIF(miles < 100,rate_under_100 * miles,rate_over_100 * miles)
 

Users who are viewing this thread

Back
Top Bottom