tbcwarrior
Registered User.
- Local time
- Today, 05:53
- Joined
- Oct 10, 2006
- Messages
- 26
Below is the code that i have made to grey out certain options when you pick certain names in a field
the only issue i have is when i want to look at records already completed, ie if combo box 2 says residential, it should not be greyed out but when i am scrolling through the completed records residential is greyed out is there any additional code i can add to re enable the field when scrolling through records
Private Sub combo2_AfterUpdate()
If Me.combo2.Value = "Commercial - Offices" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Commercial - Industrial unit" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Commercial - Retail unit" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Commercial - Semi commercial" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Commercial - Public house" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Commercial - Hotel" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Commercial - Unit" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Commercial - Factory" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Development (1 Property)" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Development (2 or More Properties)" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Commercial - Other" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Other" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Residential Farm" Then
Me.combo4.Enabled = True
ElseIf Me.combo2.Value = "Residential" Then
Me.combo4.Enabled = True
Else
Me.combo3.Enabled = True
Me.combo4.Enabled = False
End If
End Sub
the only issue i have is when i want to look at records already completed, ie if combo box 2 says residential, it should not be greyed out but when i am scrolling through the completed records residential is greyed out is there any additional code i can add to re enable the field when scrolling through records
Private Sub combo2_AfterUpdate()
If Me.combo2.Value = "Commercial - Offices" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Commercial - Industrial unit" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Commercial - Retail unit" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Commercial - Semi commercial" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Commercial - Public house" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Commercial - Hotel" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Commercial - Unit" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Commercial - Factory" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Development (1 Property)" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Development (2 or More Properties)" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Commercial - Other" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Other" Then
Me.combo3.Enabled = False
Me.combo4.Enabled = False
ElseIf Me.combo2.Value = "Residential Farm" Then
Me.combo4.Enabled = True
ElseIf Me.combo2.Value = "Residential" Then
Me.combo4.Enabled = True
Else
Me.combo3.Enabled = True
Me.combo4.Enabled = False
End If
End Sub