Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UCase& and Locale Settings. Problems

Status
Not open for further replies.

wadey

Programmer
Jun 6, 2006
54
GB
Is there any reason while Ucase$ compare would not work if the user 'fiddled' with their locale settings? example code:-

UserName = "user1"

Select Case UCase$(UserName)
case "USER1","USER2,"USER3"
'some code here
end select

this works on my dev machine in the IDE, but once compiled and installed on users machine, doesn't work. Help.
 
Is it possible that the problem is further-reaching that you are hinting at here? I mean, in the sample code you've posted it's 100% certain that UserName is going to match "USER1" because you're setting it in the line above! Isn't it more likely that in the live environment the UserName string is getting set to something unexpected?

Why not code it like this:

Select Case UCase$(UserName)
case "USER1","USER2,"USER3"
'some code here

case Else
Msgbox "Unexpected UserName: " & UCase$(UserName)

end select


- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top