By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,484 Members | 1,811 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,484 IT Pros & Developers. It's quick & easy.

3 Comboboxes

100+
P: 173
Hi,

How can i hide or disable one combobox when another combobox is selected?

All help will be appreciated

thanks
Sep 10 '07 #1
Share this Question
Share on Google+
11 Replies


damonreid
Expert 100+
P: 114
You can just do an if loop or a case select on each of the combo boxes to disable the other ones when selected on the first.
Expand|Select|Wrap|Line Numbers
  1. me.comboboxnumber.enabled = false
Sep 10 '07 #2

100+
P: 173
You can just do an if loop or a case select on each of the combo boxes to disable the other ones when selected on the first.
Expand|Select|Wrap|Line Numbers
  1. me.comboboxnumber.enabled = false

ok thats brill..but how would i enable them by clicking on them?
Sep 10 '07 #3

damonreid
Expert 100+
P: 114
If you want to be able to change it perhaps you should change the locked status and not the enable status? If this is what you want to do then.

Else try this.
Expand|Select|Wrap|Line Numbers
  1. me.comboboxname.enable = true
Sep 10 '07 #4

100+
P: 173
If you want to be able to change it perhaps you should change the locked status and not the enable status? If this is what you want to do then.

Else try this.
Expand|Select|Wrap|Line Numbers
  1. me.comboboxname.enable = true

sorry but i dont understand, ive got three comboboxes, Combo2, Combo4 and Combo6.

Ive put the following in Combo2:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo2_AfterUpdate()
  2.     blnUser = True
  3.     FilterSubForm
  4.  
  5.     Me!Text18.ControlSource = "[ID]"
  6.  
  7.   Me.Combo4.Enabled = True
  8.   Me.Combo6.Enabled = True
  9.     Me.Combo2.Requery
  10. End Sub
But its not doing anything? am i doing something obviously wrong?
Sep 10 '07 #5

damonreid
Expert 100+
P: 114
Do you want them to only use one combo box?
If so change the ".enabled = true" to ".enabled = false" for the other two combo boxes.
Sep 10 '07 #6

100+
P: 173
Do you want them to only use one combo box?
If so change the ".enabled = true" to ".enabled = false" for the other two combo boxes.

okay but then i cant click on the other two... it disables them...


What i want is: The user can only select from one combobox but if he wants to select from another, he just puts the cursor over it and it enables...

i was told this wasnt possible? is that true?
Sep 10 '07 #7

damonreid
Expert 100+
P: 114
I am not sure what the point is in disabling them, why not just leave the fields open?

You could add an "After Update" event on each of the fields to clear the values in the other two if you want?
Sep 10 '07 #8

100+
P: 173
I am not sure what the point is in disabling them, why not just leave the fields open?

You could add an "After Update" event on each of the fields to clear the values in the other two if you want?

Ok, thats a good idea, becoz the comboboxes dont clear...

what would i put in the after update event for it to clear?

thanks so far bud
Sep 10 '07 #9

damonreid
Expert 100+
P: 114
Try this
Expand|Select|Wrap|Line Numbers
  1. me.comboxboxname.value = ""
Sep 10 '07 #10

100+
P: 173
Try this
Expand|Select|Wrap|Line Numbers
  1. me.comboxboxname.value = ""

thanks damon! for all the help
Sep 11 '07 #11

damonreid
Expert 100+
P: 114
No problem, glad I could help.
Sep 11 '07 #12

Post your reply

Sign in to post your reply or Sign up for a free account.