Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
userform help
can someone tell me why i get the message box no matter what i type in? if i
only use 1 condition, it works, as soon as i add the second, nothing works. If UCase(Trim(Me.LSite.Value)) < "M" Or _ UCase(Trim(Me.LSite.Value)) < "N" Then Me.LSite.SetFocus MsgBox "Please Check Site" Exit Sub End If -- Gary |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
userform help
Do a little truth table:
Entry <"M" <"N" <"M" Or <"N" M FALSE TRUE TRUE N TRUE FALSE TRUE A TRUE TRUE TRUE I suspect your want "And" instead of "Or" Entry <"M" <"N" <"M" And <"N" M FALSE TRUE FALSE N TRUE FALSE FALSE A TRUE TRUE TRUE In article , "Gary Keramidas" <GKeramidasATmsn.com wrote: can someone tell me why i get the message box no matter what i type in? if i only use 1 condition, it works, as soon as i add the second, nothing works. If UCase(Trim(Me.LSite.Value)) < "M" Or _ UCase(Trim(Me.LSite.Value)) < "N" Then Me.LSite.SetFocus MsgBox "Please Check Site" Exit Sub End If |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
userform help
Because your test drives it that way.
If it is equal to M, it will pass the < "N" test If it is equal to N, it will pass the < "M" test If neither N nor M, it will pass the < "M" test Are you sure you don't mean AND instead of OR -- HTH RP (remove nothere from the email address if mailing direct) "Gary Keramidas" <GKeramidasATmsn.com wrote in message ... can someone tell me why i get the message box no matter what i type in? if i only use 1 condition, it works, as soon as i add the second, nothing works. If UCase(Trim(Me.LSite.Value)) < "M" Or _ UCase(Trim(Me.LSite.Value)) < "N" Then Me.LSite.SetFocus MsgBox "Please Check Site" Exit Sub End If -- Gary |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
userform help
i only want to accept M and N as possible entries, nothing else.
-- Gary "Bob Phillips" wrote in message ... Because your test drives it that way. If it is equal to M, it will pass the < "N" test If it is equal to N, it will pass the < "M" test If neither N nor M, it will pass the < "M" test Are you sure you don't mean AND instead of OR -- HTH RP (remove nothere from the email address if mailing direct) "Gary Keramidas" <GKeramidasATmsn.com wrote in message ... can someone tell me why i get the message box no matter what i type in? if i only use 1 condition, it works, as soon as i add the second, nothing works. If UCase(Trim(Me.LSite.Value)) < "M" Or _ UCase(Trim(Me.LSite.Value)) < "N" Then Me.LSite.SetFocus MsgBox "Please Check Site" Exit Sub End If -- Gary |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
userform help
See my reply.
In article , "Gary Keramidas" <GKeramidasATmsn.com wrote: i only want to accept M and N as possible entries, nothing else. -- |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
userform help
and seems to work, thanks
-- Gary "JE McGimpsey" wrote in message ... See my reply. In article , "Gary Keramidas" <GKeramidasATmsn.com wrote: i only want to accept M and N as possible entries, nothing else. -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userform from a Userform Problem | Excel Programming | |||
Looping procedure calls userform; how to exit loop (via userform button)? | Excel Programming | |||
Activating userform and filling it with data form row where userform is activate | Excel Programming | |||
Access from add_in userform to main template userform.... | Excel Programming | |||
Linking userform to userform in Excel 2003 | Excel Programming |