By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,487 Members | 1,747 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,487 IT Pros & Developers. It's quick & easy.

fOSUserName for Multiple UserNames

P: 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

Feb 15 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Henry Stockbridge wrote:
Any help you can lend would be appreciated. Here is the


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
Feb 15 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.