> I would like activated a check box (CheckYesNo)
> if a value is selected in a drop-down list (cmbList).
>
> I tested this but...
>
> Private Sub cmbList_AfterUpdate()
> Me.CheckYesNo.Value = True
> End Sub
>
> et ceci
>
> Private Sub cmbList_AfterUpdate()
> Me.CheckYesNo.Value = "Yes"
> End Sub
>
> Private Sub cmbList_AfterUpdate()
> Me.CheckYesNo.Value = "-1"
> End Sub
>
> Private Sub cmbList_AfterUpdate()
> Me.CheckYesNo.Value = "1"
> End Sub
>
> Yves
You need to tell it what was selected, if anything:
***************************************************
1) If you want the checkbox activated regardless of what
was selected, then:
Private Sub cmbList_AfterUpdate()
If IsNull(Me.cmbList).Value Then
Me.CheckYesNo.Value = False
Else
Me.CheckYesNo.Value = True
End If
End Sub
2) If you have something specific in mind, and cmbList stores a string:
Private Sub cmbList_AfterUpdate()
If Me.cmbList.Value = "red" Then
Me.CheckYesNo.Value = True
Else
Me.CheckYesNo.Value = False
End If
End Sub
3) If you have something specific in mind, and cmbList stores a number:
Private Sub cmbList_AfterUpdate()
If Me.cmbList.Value = 1 Then
Me.CheckYesNo.Value = True
Else
Me.CheckYesNo.Value = False
End If
End Sub
***************************************************
- Kurt
|