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

Enabling/ Disabling Combo Boxes

P: n/a
Hi All,

This message is a continuation of an earlier post, so please accept my
apologies as I believe I would get a better response this way.

Problem:

I have 4 combo boxes which I want to able to enable/ disable depending
on the selection made in the first combo.

Below I have the code I am using

Private Sub Lead_AfterUpDate()

Me.Purchase.Enabled = Not (Me.Lead = "Not Interested")
Me.Package.Enabled = Not (Me.Lead = "Not Interested")
Me.Users.Enabled = Not (Me.Lead = "Not Interested")
End Sub

This works fine, But I now need to add another option in the 'Lead'
combo box to do the same thing.

i.e.
the user can select "Not Interested" and 'Purchase', 'Package',
'Users' become disabled.

Now I need the user to select "Unavailable" and return the same
results. eg disable 'Purchase', 'Package', 'Users'.

kindest regards
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
tom
Try This (warning: Air Code. Untested.:

Private Sub Lead_AfterUpDate()

On Error Resume Next

Dim EnableEm as Boolean
Dim LeadVal as String

LeadVal = nz(Me.Lead.Value, "")

EnableEm = Not ((LeadVal = "Not Interested") Or (LeadVal =
"Unavailable") Or (Leadval = ""))

Me.Purchase.Enabled = EnableEm
Me.Package.Enabled = EnableEm
Me.Users.Enabled = EnableEm
End Sub
le*@prologic.ie (Cillies) wrote in message news:<ba**************************@posting.google. com>...
Hi All,

This message is a continuation of an earlier post, so please accept my
apologies as I believe I would get a better response this way.

Problem:

I have 4 combo boxes which I want to able to enable/ disable depending
on the selection made in the first combo.

Below I have the code I am using

Private Sub Lead_AfterUpDate()

Me.Purchase.Enabled = Not (Me.Lead = "Not Interested")
Me.Package.Enabled = Not (Me.Lead = "Not Interested")
Me.Users.Enabled = Not (Me.Lead = "Not Interested")
End Sub

This works fine, But I now need to add another option in the 'Lead'
combo box to do the same thing.

i.e.
the user can select "Not Interested" and 'Purchase', 'Package',
'Users' become disabled.

Now I need the user to select "Unavailable" and return the same
results. eg disable 'Purchase', 'Package', 'Users'.

kindest regards

Nov 13 '05 #2

P: n/a
Have you tried a select case statement
(Air Code)

Private Sub Lead_AfterUpDate()
Dim strLead as String
strLead = Me.Lead
Select Case strLead
Case "Not Interested"
Me.Purchase.Enabled = True
Me.Package.Enabled = True
Me.Users.Enabled = True

Case "Unavailable"
Me.Purchase.Enabled = False
Me.Package.Enabled = False
Me.Users.Enabled = False
Case Else
Nov 13 '05 #3

P: n/a
Have you tried a select case statement
(Air Code)

Private Sub Lead_AfterUpDate()
Dim strLead as String
strLead = Me.Lead
Select Case strLead
Case "Not Interested"
Me.Purchase.Enabled = True
Me.Package.Enabled = True
Me.Users.Enabled = True

Case "Unavailable"
Me.Purchase.Enabled = False
Me.Package.Enabled = False
Me.Users.Enabled = False
Case Else
Nov 13 '05 #4

P: n/a
Thanks guys, It works a treat.

Tom, Your air code was spot on. Reggie I encountered some problems with
your select case statement, where it would disable the combos but not in
the way intended. after selecting options in the combo1 box twice, all
the combos would become enabled, but thanks very much for your time and
consideration with my problem, much appreciated.
kindest Regards


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #5

P: n/a
Thanks guys, It works a treat.

Tom, Your air code was spot on. Reggie I encountered some problems with
your select case statement, where it would disable the combos but not in
the way intended. after selecting options in the combo1 box twice, all
the combos would become enabled, but thanks very much for your time and
consideration with my problem, much appreciated.
kindest Regards


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.