Solved

Access - On Open Event Procedure - Report

Posted on 2006-07-17
2
621 Views
Last Modified: 2008-03-10
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.
0
Comment
Question by:lawson2305
  • 2
2 Comments
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 17123680
Try this ...

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

ET
0
 
LVL 19

Accepted Solution

by:
Eric Sherman earned 250 total points
ID: 17123701
Actually you should use AND in place of OR, my mistake.

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


ET
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question