I have an option group with 4 toggle buttons on a form, which the user selects personnel type to show their respective records on a tabbed form. Each toggle button on the After Update, shows their respective list box listing the personnel (either Salary, Hourly, All or Terminated). When an employee is selected within the list box, the tabbed form reflets all their information. Everything works good.
Now what I want is the toggle buttons to disable based on a security level which is a number field shown on the form in a hidden text box called SecurityLevel.
I have been playing around with this and either it disables all toggle buttons, or it is not reading the security level correctly. I would like them disabled on the opening of the form, but my coding disabled the whole option grouping.
Below is my original code:
Private Sub Frame359_AfterUpdate()
On Error Resume Next
If Frame359 = 1 Then
Salary.Visible = True
Hourly.Visible = False
All.Visible = False
Terminated.Visible = False
ElseIf Frame359 = 2 Then
Salary.Visible = False
Hourly.Visible = True
All.Visible = False
Terminated.Visible = False
ElseIf Frame359 = 3 Then
Salary.Visible = False
Hourly.Visible = False
All.Visible = True
Terminated.Visible = False
ElseIf Frame359 = 4 Then
Salary.Visible = False
Hourly.Visible = False
All.Visible = False
Terminated.Visible = True
ElseIf Frame359 = 0 Then
Salary.Visible = False
Hourly.Visible = False
All.Visible = False
Terminated.Visible = False
Exit Sub
End If
End Sub
Also, is it possible within a query to select only certain records based on a securitylevel. Again, getting back to the hourly/salary situation.
Thanks
Now what I want is the toggle buttons to disable based on a security level which is a number field shown on the form in a hidden text box called SecurityLevel.
I have been playing around with this and either it disables all toggle buttons, or it is not reading the security level correctly. I would like them disabled on the opening of the form, but my coding disabled the whole option grouping.
Below is my original code:
Private Sub Frame359_AfterUpdate()
On Error Resume Next
If Frame359 = 1 Then
Salary.Visible = True
Hourly.Visible = False
All.Visible = False
Terminated.Visible = False
ElseIf Frame359 = 2 Then
Salary.Visible = False
Hourly.Visible = True
All.Visible = False
Terminated.Visible = False
ElseIf Frame359 = 3 Then
Salary.Visible = False
Hourly.Visible = False
All.Visible = True
Terminated.Visible = False
ElseIf Frame359 = 4 Then
Salary.Visible = False
Hourly.Visible = False
All.Visible = False
Terminated.Visible = True
ElseIf Frame359 = 0 Then
Salary.Visible = False
Hourly.Visible = False
All.Visible = False
Terminated.Visible = False
Exit Sub
End If
End Sub
Also, is it possible within a query to select only certain records based on a securitylevel. Again, getting back to the hourly/salary situation.
Thanks