Hi all,
I'm SUPER new to posting to a forum, but I have been using your site for sometime now and appreciate all your great advice.
With that said. I am working on a workflow management db for my group. There are 3 admins and 4 users. I have it set up currently through the Access Security wizard. My issue sounds simple, but I can't get the darn thing to work.
All I want is for one of my forms to disable certain buttons if the person is NOT in the admin group. If that cannot be done easily, I would like to tell it if that current user is not one of these 3 people, disable the buttons. I will supply my code below. The problem is when I get more than one person in the if statement, it ends up disabling the buttons for every users.
I would appreciate any help you can give me. If you can think of an easier way, that would be great too. I can muttle my way through coding VBA.
Private Sub Form_load()
DoCmd.Maximize
If Not Application.CurrentUser() = "hendrixs" Then
Me.cmdLeadFormOpen.Visible = False
Me.cmdCurrentOpenJobsReport.Enabled = False
Me.Command36.Enabled = False
Me.cmdRptPastDue.Enabled = False
Me.cmdReportAssignedTo.Enabled = False
Me.cmdReportJobsByCategory.Enabled = False
Me.cmdReportByStatus.Enabled = False
ElseIf Not Application.CurrentUser() = "mbaptist" Then
Me.cmdLeadFormOpen.Enabled = False
Me.cmdCurrentOpenJobsReport.Enabled = False
Me.Command36.Enabled = False
Me.cmdRptPastDue.Enabled = False
Me.cmdReportAssignedTo.Enabled = False
Me.cmdReportJobsByCategory.Enabled = False
Me.cmdReportByStatus.Enabled = False
ElseIf Not CurrentUser() = "olopez" Then
Me.cmdLeadFormOpen.Enabled = False
Me.cmdCurrentOpenJobsReport.Enabled = False
Me.Command36.Enabled = False
Me.cmdRptPastDue.Enabled = False
Me.cmdReportAssignedTo.Enabled = False
Me.cmdReportJobsByCategory.Enabled = False
Me.cmdReportByStatus.Enabled = False
End If
Thank you in advance.
I'm SUPER new to posting to a forum, but I have been using your site for sometime now and appreciate all your great advice.
With that said. I am working on a workflow management db for my group. There are 3 admins and 4 users. I have it set up currently through the Access Security wizard. My issue sounds simple, but I can't get the darn thing to work.
All I want is for one of my forms to disable certain buttons if the person is NOT in the admin group. If that cannot be done easily, I would like to tell it if that current user is not one of these 3 people, disable the buttons. I will supply my code below. The problem is when I get more than one person in the if statement, it ends up disabling the buttons for every users.
I would appreciate any help you can give me. If you can think of an easier way, that would be great too. I can muttle my way through coding VBA.
Private Sub Form_load()
DoCmd.Maximize
If Not Application.CurrentUser() = "hendrixs" Then
Me.cmdLeadFormOpen.Visible = False
Me.cmdCurrentOpenJobsReport.Enabled = False
Me.Command36.Enabled = False
Me.cmdRptPastDue.Enabled = False
Me.cmdReportAssignedTo.Enabled = False
Me.cmdReportJobsByCategory.Enabled = False
Me.cmdReportByStatus.Enabled = False
ElseIf Not Application.CurrentUser() = "mbaptist" Then
Me.cmdLeadFormOpen.Enabled = False
Me.cmdCurrentOpenJobsReport.Enabled = False
Me.Command36.Enabled = False
Me.cmdRptPastDue.Enabled = False
Me.cmdReportAssignedTo.Enabled = False
Me.cmdReportJobsByCategory.Enabled = False
Me.cmdReportByStatus.Enabled = False
ElseIf Not CurrentUser() = "olopez" Then
Me.cmdLeadFormOpen.Enabled = False
Me.cmdCurrentOpenJobsReport.Enabled = False
Me.Command36.Enabled = False
Me.cmdRptPastDue.Enabled = False
Me.cmdReportAssignedTo.Enabled = False
Me.cmdReportJobsByCategory.Enabled = False
Me.cmdReportByStatus.Enabled = False
End If
Thank you in advance.