Results 1 to 3 of 3

Thread: Easy If statement prob... [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575

    Easy If statement prob... [RESOLVED]

    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:
    1. If CurrentUser <> "User1" Or "User2" Or "User3" Then

    CurrentUser is defined like this:

    VB Code:
    1. Private Function CurrentUser() As String
    2. Dim sBuf As String
    3.  
    4. ' allocate maximum string size
    5. sBuf = String(255, Chr(0))
    6. GetUserName sBuf, 255
    7. CurrentUser = sBuf
    8.  
    9. 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
    Last edited by LITHIA; Sep 6th, 2003 at 11:25 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width