Disable fields based on value selected in Combo box

popeye

Work smarter, not harder.
Local time
Today, 03:30
Joined
Aug 23, 2004
Messages
75
i want to be able to select a phrase from a combo box and when that particular phrase is selected then some fields in particular become disabled.
 
popeye,

Use the AfterUpdate event of the ComboBox to:

Code:
Select Case Me.YourCombo
   Case "TextA"
      Me.Field1.Enabled = False
      Me.Field2.Enabled = False
      Me.Field3.Enabled = True
      Me.Field4.Enabled = True
   Case "TextB"
      Me.Field1.Enabled = True
      Me.Field2.Enabled = True
      Me.Field3.Enabled = False
      Me.Field4.Enabled = False
   End Select

Wayne
 
thanks

as we in Jamaica would say

Respect Mon, Di I Cool enu...
bless.
 
ok, i want the fields not only disabled, but their values returned to zero

i want the disabled fields to have the value zero displayed in them anbd saved to the table.

Please advise :)
 
the same code as mentioned by WayneRyan with an addition of the following

Select Case Me.YourCombo
Case "TextA"
Me.Field1.Enabled = False
Me.Field2.Enabled = False
Me.Field3.Enabled = True
Me.Field4.Enabled = True

Me.Field1.Value = 0
Me.Field2.Value = 0
Me.Field3.Enabled = WhatEverValueYouWant
Me.Field4.Enabled = WhatEverValueYouWant

End Select
 

Users who are viewing this thread

Back
Top Bottom