Enable/Disable 2 List boxes Based on Combo Box Selection (1 Viewer)

Strike_Eagle

Registered User.
Local time
Yesterday, 23:11
Joined
Oct 20, 2011
Messages
48
Hello,

I have a problem with enabling one of two list boxes based on a combo box selection. Names of each element are:

Combo Box:
rdlSpecialist (assigned value of 1)
rdlSupervisor (assigned value of 2)

List Box:
SpecialistSelect
Supervisor_Name

rdlSpecialist enables SpecialistSelect and rdlSupervisor enables Supervisor_Name. Of course, whichever is enabled, the other should be disabled.

I have tried a multitude of varieties of code that I could think of and found online, and all located on the After Event [Event Procedure]. None get me the desired result, or even partially work for that matter. I am using Access 2007 on a Windows XP system.

A sampling of my latest rendition of code is:

Private Sub SupervisorSpecialistSelectFrame_AfterUpdate()
If Me.rdlSpecialist = 1 Then
SpecialistSelect.Enable
Else
Supervisor_Name.Enable
End If
End Sub


Thank you greatly in advance. I have been parusing this site on and off for years, but have never have come accross a prolem I couldn't figure out within a reasonable amount of time before. I hope I asked my question clearly, and please interrogate me for as much information as you need.

Strike_Eagle
 

Strike_Eagle

Registered User.
Local time
Yesterday, 23:11
Joined
Oct 20, 2011
Messages
48
I had a feeling it was something simple...and it was. I was using a frame and tried to base my results on the individual buttons instead of the frame.

Private Sub SupervisorSpecialistSelectFrame_AfterUpdate()
If Me.SupervisorSpecialistSelectFrame = 1 Then
Me.SpecialistSelect.Enabled = True
Else
Me.SpecialistSelect.Enabled = False
End If
If Me.SupervisorSpecialistSelectFrame = 2 Then
Me.Supervisor_Name.Enabled = True
Else
Me.Supervisor_Name.Enabled = False
End If
End Sub

was my solution. Thank you all for reviewing, and sorry to have wasted your time. Lesson learned, when using buttons individually, base on buttons. When using a frame, base on frame. So simple... ughhhh
 

vbaInet

AWF VIP
Local time
Today, 05:11
Joined
Jan 22, 2010
Messages
26,374
Good to see that you figured it out :)

Here are two lines of equivalent to yours:
Code:
Me.SpecialistSelect.Enabled = (Me.SupervisorSpecialistSelectFrame = 1)
Me.Supervisor_Name.Enabled = (Me.SupervisorSpecialistSelectFrame = 2)
 

Strike_Eagle

Registered User.
Local time
Yesterday, 23:11
Joined
Oct 20, 2011
Messages
48
Thank you. I thought of that, after a ton of reading, but wasn't sure how to implement that style with 18 layers of radial buttons, each enabling a different set of list, combo, and check boxes.

I will be working on fine tuning and making the code more efficent, and for that, I will definately be cruising the forums and books again. In the mean time, I will be happy with working! LOL
 

vbaInet

AWF VIP
Local time
Today, 05:11
Joined
Jan 22, 2010
Messages
26,374
That was just fyi. I don't think it makes it more effecient, it's just less lines of code. ;)

Happy developing!
 

Users who are viewing this thread

Top Bottom