The title says it all. I have user rights set up(in a module called globals) and they control access and viewing capabilities throughout the database based on the user login. I have not run into any issues with it except for with my reports. So, here it is. I have a report that is generated from a query. The query is then used as a record source for a sub form. I have one column(txtcommissiondue) that needs to be hidden from certain users, and displayed for others. On the subform itself, my code works fine. When a user doesn't have access, they don't see it. When users have access, they do see it. When they go to print the report from the subform, the column will show up regardless of user rights. My solution was to apply the code to the report as well, but that is not working
Private Sub Form_Load()
If Globals.UserAccess(Me.Name) = False Then
Forms!frmPurchaseOrders!PurchaseOrderssub.Form.txt CommissionDue.ColumnHidden = -1
End If
End Sub
However, when I try this on a report it hides it no matter what user is logged in, and throws that Enter Parameter Value pop up at me.
Private Sub Report_Load()
If Globals.UserAccess(Me.Name) = False Then
Reports!rptPurchaseOrders.txtCommissionDue.Visible = False
Reports!rptPurchaseOrders.CommissionDue_lbl.Visibl e = False
End If
End Sub
If anyone can point me in the right direction, i would appreciate it.
Thanks