I have form1 and form2. On form 2 i have 2 combo boxes where the user is asked to make selections. once back on form1 i try to use those selections as part of an if statement but although i should be triggring them it does not. I cannot figure this out. I have set up test variables and msgboxes along the way to test this.
The code excecutes. I have double checked the variables on form 2. They just do not trigger a response that will enter the if statements even though it looks like they should
I have double checked that test1 and test 2 are grabbing the variables from form 2
test1 is "Male"
test2 is "10 - 19"
When the code excecutes i never get to the msgbox("Age") line of code. I have also tried taking the spaces out of the strings with no luck as well.
Code:Dim test1 As String = aselect.sex Dim test2 As String = aselect.age If aselect.age = "2 - 9" Then If aselect.sex = "Male" Then If q > 5 And q < 40 Then patient_frm.lthor_kypt = 1 End If If q < 5 Or q > 40 Then patient_frm.lthor_kypt = 2 End If End If If aselect.sex = "Female" Then If q > 8 And q < 36 Then patient_frm.lthor_kypt = 1 End If If q < 8 Or q > 36 Then patient_frm.lthor_kypt = 2 End If End If End If If aselect.age = "10 - 19" Then MsgBox("Age") If aselect.sex = "Male" Then If q > 8 And q < 39 Then patient_frm.lthor_kypt = 1 End If If q < 8 Or q > 39 Then patient_frm.lthor_kypt = 2 End If End If If aselect.sex = "Female" Then If q > 11 And q < 41 Then patient_frm.lthor_kypt = 1 End If If q < 11 Or q > 41 Then patient_frm.lthor_kypt = 2 End If End If End If




Reply With Quote