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

Combobox control

100+
P: 173
Hi,

Ive got a form which has three Comboboxes, 1) User, 2) Department and 3) Site....

Underneath the comboboxes i have a subform which displays records if i select a user, department or a site..

What i want to know is, if i select one combobox, how do i dim out the other two comboboxes? so if i choose a user from the user combobox, how can i shade away the department and site comboboxes?

all help will be appreciated ..


thanks
Sep 3 '07 #1
Share this Question
Share on Google+
5 Replies


Expert 100+
P: 126
Hi,

Ive got a form which has three Comboboxes, 1) User, 2) Department and 3) Site....

Underneath the comboboxes i have a subform which displays records if i select a user, department or a site..

What i want to know is, if i select one combobox, how do i dim out the other two comboboxes? so if i choose a user from the user combobox, how can i shade away the department and site comboboxes?

all help will be appreciated ..


thanks
Look at the after_update() property, and use the following code for each of the other combo-boxes:
comboWhatever.enabled = False
Sep 3 '07 #2

100+
P: 173
Look at the after_update() property, and use the following code for each of the other combo-boxes:
comboWhatever.enabled = False

thank you for your reply,

for my comboboxes ive already got some data in the after_update event, for example one of the combos has:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo2_AfterUpdate()
  2.     blnUser = True
  3.     FilterSubForm
  4.  
  5.   Me.Combo2.Requery
  6.  
  7. End Sub
where would i insert
Expand|Select|Wrap|Line Numbers
  1. comboWhatever.enabled = False
??

thanks
Sep 3 '07 #3

100+
P: 173
any1? im kinda stuck.....

thanks peeps
Sep 3 '07 #4

100+
P: 173
If the combobox after_update event is occupied with other code,

where would i insert
Expand|Select|Wrap|Line Numbers
  1. comboWhatever.enabled = False
?
Sep 4 '07 #5

MMcCarthy
Expert Mod 10K+
P: 14,534
Using this example and assuming the other two combo boxes are 1 and 3 ....

Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo2_AfterUpdate()
  2.  
  3.     Me.Combo1.Enabled = False
  4.     Me.Combo3.Enabled = False
  5.  
  6.     blnUser = True
  7.     FilterSubForm
  8.  
  9.     Me.Combo2.Requery
  10.  
  11. End Sub
  12.  
Beany it would help the experts if in future you experimented a little with the advice you are given to see for yourself how it works. Then if you don't get the behaviour you expect you can tell the experts what you have tried. If the experts can't see that you are trying to figure it out for yourself they will be discouraged from helping you.

Mary
Sep 5 '07 #6

Post your reply

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