Connecting Tech Pros Worldwide Help | Site Map

fOSUserName for Multiple UserNames

Henry Stockbridge
Guest
 
Posts: n/a
#1: Feb 15 '06
Hi,

I am attempting to incorporate Dev Ashish's fOSUserName code with
multiple UserNames but come up with a runtime error (13) / Type
mismatch. Any help you can lend would be appreciated. Here is the
code:

'=================
Sub cmdNext_Click()

Dim strName As String
strName = fOSUserName

If strName Like "doejane" Or "doejohn" Or "hancockjohn" Then
' Run this code...
Else
' Run this code....
End If

End Sub
'=================

Henry

Tim Marshall
Guest
 
Posts: n/a
#2: Feb 15 '06

re: fOSUserName for Multiple UserNames


Henry Stockbridge wrote:
[color=blue]
> Any help you can lend would be appreciated. Here is the[/color]

Try:

If strName Like "doejane" Or strName Like "doejohn" Or strName Like
"hancockjohn" Then

I personally would use = instead of the like operator here if you don't
specify any wildcards.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Closed Thread