Connecting Tech Pros Worldwide Help | Site Map

fOSUserName for Multiple UserNames

  #1  
Old February 15th, 2006, 03:55 PM
Henry Stockbridge
Guest
 
Posts: n/a
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

  #2  
Old February 15th, 2006, 05:15 PM
Tim Marshall
Guest
 
Posts: n/a

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