Restricted Employee Access to Reports (1 Viewer)

SetanPutih

Registered User.
Local time
Today, 06:27
Joined
Jun 27, 2019
Messages
27
Thanks for the reply.. I really appreciate it. Just to clarify so its a single quote mark ' rather than a double quote mark " only around the EmployeeID?
 

SetanPutih

Registered User.
Local time
Today, 06:27
Joined
Jun 27, 2019
Messages
27
So the first line would look like.. ? Sorry again. Really new to this.

Select Case Me.List2.Value
Case "Employee Activity Report"
DoCmd.OpenReport reportname:="rptEmpActivity", WhereCondition:=’[EmployeeID]='’& gEmployeeID & ‘", view:=acViewReport
Case "Training"
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:27
Joined
Sep 21, 2011
Messages
14,041
No, probably like

Code:
DoCmd.OpenReport reportname:="rptEmpActivity", WhereCondition:="[EmployeeID]=" & gEmployeeID , view:=acViewReport

TBH I have never used keyword parameters, just positional.

Code:
DoCmd.OpenReport "rptEmpActivity",acViewReport,,"EmployeeID=" & gEmployeeID

Intellisense will walk you through each parameter in turn.

https://docs.microsoft.com/en-us/office/vba/api/access.docmd.openreport

The quotes/or not are around the value of what you are looking for, not the name of the field.

HTH
 

SetanPutih

Registered User.
Local time
Today, 06:27
Joined
Jun 27, 2019
Messages
27
it Worked! You legend! If I could buy you a pint I'd buy you two.

Thank you
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:27
Joined
Sep 21, 2011
Messages
14,041
Just glad I got it right. :D
 

Users who are viewing this thread

Top Bottom