PDA

View Full Version : Solved: Very Simple if statement in after_update for combo boxes



Austin
09-14-2008, 01:42 PM
Why does this code not work.



Private Sub cboCollateral_AfterUpdate()
If Me.cboCollateral.Value = "" Then

Me.cboConcentration.Visible = True
Me.cboFieldofFocus.Visible = True
Else
Me.cboConcentration.Value = ""
Me.cboConcentration.Visible = False
Me.cboFieldofFocus.Value = ""
Me.cboFieldofFocus.Visible = False
End If
End Sub

I just want to disable two combo boxes if anything is selected in this cboCollateral but if the user changes their mind I want to re-enable the boxes. Well if I delete everything out of the cboCollateral it is not re-enabling the cboconcentration or cbofieldoffocus. Any Ideas?

Austin
09-14-2008, 02:00 PM
Fixed

Private Sub cboCollateral_AfterUpdate()
If IsNull(Me.cboCollateral.Value) Then

Me.cboConcentration.Visible = True
Me.cboFieldofFocus.Visible = True
Else
Me.cboConcentration.Value = ""
Me.cboConcentration.Visible = False
Me.cboFieldofFocus.Value = ""
Me.cboFieldofFocus.Visible = False
End If
End Sub