Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access - On Open Event Procedure - Report

Posted on 2006-07-17
2
Medium Priority
?
653 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1000 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

604 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