Else If Problem

1. Senior Member
Join Date
Dec 1969
Posts
121

## Else If Problem

Hi,<BR><BR>I have a problem with the following.<BR><BR>cPriceA = "0.00"<BR>cPriceB = "200.00"<BR>cPriceC = "300.00"<BR>cPriceD = "400.00"<BR><BR>If Total_Modules &#060;=1 Then<BR>ControlP = cPriceA<BR>Elseif Total_Modules &#062;=1 And Total_Modules &#060;=10 Then<BR>ControlP = cPriceB<BR>Elseif Total_Modules &#062;=9 And Total_Modules &#060;=17 Then<BR>ControlP = cPriceC<BR>Elseif Total_Modules &#062;=17 Then<BR>ControlP = cPriceD<BR>End If<BR><BR>So If Less Then 1 use cPriceA<BR>If Between 1 and 10 Then use cPriceB<BR>If Between 11 and 17 Then use cPriceC<BR>If greater than 17 Then use cPriceC<BR><BR>However it keeps returning 200.00 when 0 and above 0 it returns 0<BR><BR>I have tried working on different =&#062; or &#060;= to no avail.<BR><BR>Thanks<BR><BR>Darrell...

2. Senior Member
Join Date
Dec 1969
Posts
11,247

## RE: Else If Problem

200.00 is a double<BR><BR>you are trying to compare it to an integer!<BR><BR>If Total_Modules &#060;=1.00 Then<BR><BR>etc<BR><BR>now you will have problems when it equals 1.00 because as you have it it could be either the first or second part of your if statement

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•