Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can someone figure why the following IF statement always is true 1

Status
Not open for further replies.

Pack10

Programmer
Feb 3, 2010
495
US
I can't understand why this code always returns true...my fOSUserName is "F080424" , it should bounce out of the IF...



If (Combo570 = "Approved for Release" Or Combo570 = "Approved for Finalization Resubmit" _
Or Combo570 = "Revisions Approved" Or Combo570 = "Revisions Rejected") _
And (fOSUserName <> "U148412" Or fOSUserName <> "V093501" Or fOSUserName = "F080424") Then

MsgBox "Sorry, you are not permitted to place this into " & Combo570 & " status"
Cancel = True
End If
 
My guess:
And (fOSUserName <> "U148412" Or fOSUserName <> "V093501" And fOSUserName <> "F080424")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

my fOSUserName is [red]"F080424"[/red]

If (Combo570 = "Approved for Release" Or Combo570 = "Approved for Finalization Resubmit" _
Or Combo570 = "Revisions Approved" Or Combo570 = "Revisions Rejected") _
And (fOSUserName <> "U148412" Or fOSUserName <> "V093501" [red]Or fOSUserName = "F080424"[/red]) Then

MsgBox "Sorry, you are not permitted to place this into " & Combo570 & " status"
Cancel = True
End If


Have fun.

---- Andy
 
Soory for the typo:
My guess:
And (fOSUserName <> "U148412" And fOSUserName <> "V093501" And fOSUserName <> "F080424")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top