Access form listbox

  • Thread starter Thread starter axelwing
  • Start date Start date
A

axelwing

Guest
Hello,

I have a question about an Access 2000 form...maybe I'm dumb because I cannot find a solution for this:

I have this form with 2 list boxes ( Listbox1, which is active and Listbox2 , which is deactivated but visible ). In Listbox1 I have 2 values ( V1 and V2 ) - multiselect is not permitted, so the user can only select one of these two.
My question is:

Is there a way when the user is selecting the first value V1 from the Listbox1, the Listbox2 to change it's status from "disabled " to "enabled", allowing the user to select some values from it? Otherwise, as long V1 isn't selected, Listbox2 is keeping it's "disabled" status.

Thanks a lot and I hope not to abuse your patience.
 
all you owuld need to do is the following:

Code:
Private Sub Listbox1_Click()

If Listbox1.Column(0) = "V1" Then

Listbox2.Enabled = True

End If


End Sub


Hope this helps, you may need to change the 0 to 1 depending if you have an idnumber hidden before the V1 and V2

any issues let me know
 
Thank you!!!

Thank you so much! It was exactly what I need! THANKS!! :D
 
One more thing...

...and one more thing regarding the upper question:
What should I have to change in order to have Listbox2 disabled when V2 is selected, assuming that V1 was selected first? ( some kind of change focus I suppose but it's not clear...)

Thank you!
 
Code:
Private Sub Listbox1_Click()

If Listbox1.Column(0) = "V1" Then

Listbox2.Enabled = True

else

Listbox2.Enabled = False

End If


End Sub


sorry i forgot about that one, my fault
 

Users who are viewing this thread

Back
Top Bottom