PDA

View Full Version : Solved: Case Statement Criteria with 2 levels of assesment



aziztt
12-15-2008, 04:11 AM
Im creating a simple check if someone earns a good income with different criterias but run through a stump in coding for adding two levels to check. :banghead:

Basically theres two textboxes, Checkbox1 to enter either "Yes" or "No" if the person married. Checkbox2 to enter the total Income. CheckBox3 outputs a simple answer.

Criteria are:
Single <=1500 = "OK"
Single =>1500 and <=2000 = "Good"
Single >2000 = "Excellent

Married <=?2200 = "OK"
Married >2200 and <=3000 = "Good"
Married >3000 = "Excellent"


I tried to do a case statement as follows but doesnt check if the persons married or not, also not sure how to check values inclusive, can anyone help??


Select Case TextBox2.Value
Case "<=1500"
TextBox3.Text = "OK"

Case"=>1500 and <=2000"
TextBox3.Text = "Good"

Case ">2000"
TextBox3.Text = "Excellent"

Bob Phillips
12-15-2008, 04:42 AM
Select Case True
Case TextBox2.Value <= 1500
TextBox3.Text = "OK"

Case TextBox2.Value >= 1500 And TextBox2.Value <= 2000
TextBox3.Text = "Good"

Case TextBox2.Value > 2000
TextBox3.Text = "Excellent"
End Select