|
-
Nov 16th, 2006, 07:12 AM
#1
Thread Starter
Lively Member
[RESOLVED] Case Statement ignore capitals
Hi
I'm trying to add some validation to a text field in which the user is supposed to enter a month name. I'm wanting to check that the input is equal to one of the months of the year. I thought I could do a case statement e.g.
Select Case month.Text
Case "January"
etc........
However, it is possible that the user would enter "january" rather than "January". Is there any way that I can check the input and ignore the case so that I don't have to double the length of the select statement by putting in each month with and without a capital letter?
-
Nov 16th, 2006, 07:23 AM
#2
Hyperactive Member
Re: Case Statement ignore capitals
Hi, just convert the whole string to upercase or lower case
VB Code:
select case month.text.toupper
case "JANUARY"
'...
-
Nov 16th, 2006, 07:31 AM
#3
Thread Starter
Lively Member
Re: Case Statement ignore capitals
 Originally Posted by josep
Hi, just convert the whole string to upercase or lower case
VB Code:
select case month.text.toupper
case "JANUARY"
'...
Thanks Josep, that worked well!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|