Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toggle Button Disable/Enable

Status
Not open for further replies.

Carol57

IS-IT--Management
Nov 5, 2000
19
0
0
CA
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
 
Fixed 1st item - put a case select (referring to the securitylevel) on the On Open of the form, which enables/disables the toggle buttons.

Now for the 2nd item .....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top