0

I have attached my question.

I am having some problems with the attached question. Well here is my code:

Dim Name As String

Name = TextBox1.Text

If Name = TextBox1.Text And radLT20.Checked = True Then
txtDisplay.Text = "Name is aged below 20"

ElseIf Name = TextBox1.Text And rad20To40.Checked = True Then
txtDisplay.Text = "Name is aged between 20 and 40"

ElseIf Name = TextBox1.Text And radGT40.Checked = True Then
txtDisplay.Text = "Name is aged above 40"

End If

What is wrong with my code is that when i click on the OK button i want the name that i entered in txtName to display. How can i do it???

Attachments PICTURE14_001.jpg 67.7 KB
2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by Nawsheen
1

I assume this is your code under btnOK_Click

If radLT20.Checked = True Then
  txtDisplay.Text = "" & txtName.Text & "" & "is aged below 20"
     Elseif rad20To40.Checked = True Then
        txtDisplay.Text = "" & txtName.Text & "" & "is aged between 20 and 40"
     Elseif radGT40.Checked = True Then
          txtDisplay.Text = "" & txtName.Text & "" & "is aged above 40"
End If
Votes + Comments
This really worked
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.