Hey all,
This question is real daft but Im not sure what is wrong with my If statement. I havn't needed to do something like this before and Im getting errors so anyone know what I am doing wrong?
VB Code:
If CurrentUser <> "User1" Or "User2" Or "User3" Then
CurrentUser is defined like this:
VB Code:
Private Function CurrentUser() As String Dim sBuf As String ' allocate maximum string size sBuf = String(255, Chr(0)) GetUserName sBuf, 255 CurrentUser = sBuf End Function
Dont worry, theres no errors with that, It works fine elsewhere and I have the correct API and all.
Any ideas? Is there such thing as "Or" in an If statement? What else should I do? Thanks
Btw, I am getting an "Type Mismatch" error




Reply With Quote