I have a combo box named Color which may has values "Color-Matched", "Black" and "Natural". I want to make another fields (ColorLabel, ColorL, Colorb, Colora) visibe, if "Color-Matched" is selected in Color.
I wrote this code but it gives Run-time error '13': Type mismatch at second line:
I think the way of assignig value to combo box is not correct. But I don't have any idea how to fix it.
I wrote this code but it gives Run-time error '13': Type mismatch at second line:
Code:
Private Sub Form_Current()
If Me.Color = "Color-Matched" Then
Me.ColorLabel.Visible = True
Me.colorL.Visible = True
Me.colora.Visible = True
Me.colorb.Visible = True
Else
Me.ColorLabel.Visible = False
Me.colorL.Visible = False
Me.colora.Visible = False
Me.colorb.Visible = False
End If
End Sub
Private Sub Color_AfterUpdate()
If Me.Color = "Color-Matched" Then
Me.ColorLabel.Visible = True
Me.colorL.Visible = True
Me.colora.Visible = True
Me.colorb.Visible = True
Else
Me.ColorLabel.Visible = False
Me.colorL.Visible = False
Me.colora.Visible = False
Me.colorb.Visible = False
End If
End Sub