Link to home
Start Free TrialLog in
Avatar of lawson2305
lawson2305

asked on

Access - On Open Event Procedure - Report

I have this:
Private Sub Report_Activate()

'If CurrentUser <> "ns" Then
 '   Report.RecordSource = "qryWorksForUsername"
  '  End If
    If CurrentUser <> "ou" Then
       Report.RecordSource = "qryWorksForUsername"
    End If
   ' If CurrentUser <> "wa" Then
    '   Report.RecordSource = "qryWorksForUsername"
    'End If

End Sub

I didn't write this but now I need to modify it so that it affects more than one user as it only does now.

So I would like to make this statement

  If CurrentUser <> "ou" Then
       Report.RecordSource = "qryWorksForUsername"

effective for user ou, wa and ns all at once.  I would think there is a way to do this.
Avatar of Eric Sherman
Eric Sherman
Flag of United States of America image

Try this ...

If CurrentUser <> "ou"  OR CurrentUser <> "wa"  OR CurrentUser <> "ns" Then
       Report.RecordSource = "qryWorksForUsername"
End If

ET
ASKER CERTIFIED SOLUTION
Avatar of Eric Sherman
Eric Sherman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial