Text case question

P

Patrick C. Simonds

How can I make the YES in the code below hit even if the text in TextBox1 is
lower case or a mix of both?

If TextBox4.Text = "YES" Then
OptionButton2.Value = True
Else
OptionButton1.Value = True
End If
 
D

Dave Peterson

One way:

If lcase(TextBox4.Text) = lcase("YES") Then

If you're careful, you could use:
If lcase(TextBox4.Text) = "yes" Then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top