I don't see what I am doing wrong in this code using "Select Case". When activated and the correct string is entered I should get a msgbox pop up.
![]()
Please Login or Register to view this content.
I don't see what I am doing wrong in this code using "Select Case". When activated and the correct string is entered I should get a msgbox pop up.
![]()
Please Login or Register to view this content.
Last edited by Rick_Stanich; 10-16-2008 at 10:19 AM.
Regards
Rick
Win10, Office 365
Hi Rick_Stanich,
When you say Case 1 that is checking the value entered into sLogin and saying if it is 1 then do the code in this block.
same as Case 2, Case 3, etc...
change it to this.
and on Case 5 change the 5 to the string your checking for![]()
Please Login or Register to view this content.
There are only 10 types of people in the world:
Those who understand binary, and those who don't!
Your code logic does not make sense.
For the inner test of Inputted value you would need to convert the string value to a number before the case tests will work,
But if you enter 1 the first case test will be true so this code is executed.![]()
Please Login or Register to view this content.
Your problem now is that we already know sLogin contains "1" so it can not possible contain "RS61".![]()
Please Login or Register to view this content.
I see, I misunderstood what "Case 1" represented. I thought it meant "Case 1" as the first event and "Case 2" as the second and so on.
Thanks!
Yea no problem, easy mistake to make really![]()
You don't need the If to test for blank entry statement either
![]()
Please Login or Register to view this content.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
One more question. :D
I now display a msgbox when the Case is true, how do I capture when it is not true? (and show a msgbox).
HAHA
You answered my question before I posted, how astute!
Case closed!
hehe
I kill me!![]()
not sure exactly what you mean do you mean to check if it is not a certain value like is not RS61.
can you explain a little more??
EDIT: Lol i was too late
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks