G
Guest
Hi,
I have a multiselect box that has a number of choices, one of which is "None"
I would like to program the box to trigger a Msgbox if "None" is selected
in addition to other choices, as they are incompatible.
One option would be to leave "none" as the default text box data, but I
don't want to do that.
I'm thinking something like:
If strselected (some parse = "None")& not "" Then
msgbox "Cannot have 'None' and other selections--must deselect one"
My current code for the box so far is:
'taking selected limits to txtLimitsfrmlbx
Private Sub lbxLimits_LostFocus()
Dim strSelected As String
Dim varSelected As Variant
For Each varSelected In Me.lbxLimits.ItemsSelected
strSelected = strSelected & _
Me.lbxLimits.Column(1, varSelected) & vbCrLf
Next varSelected
txtLimitsFrmlbx.SetFocus
txtLimitsFrmlbx.Text = strSelected
End Sub
Thank you for any ideas,
Karl
I have a multiselect box that has a number of choices, one of which is "None"
I would like to program the box to trigger a Msgbox if "None" is selected
in addition to other choices, as they are incompatible.
One option would be to leave "none" as the default text box data, but I
don't want to do that.
I'm thinking something like:
If strselected (some parse = "None")& not "" Then
msgbox "Cannot have 'None' and other selections--must deselect one"
My current code for the box so far is:
'taking selected limits to txtLimitsfrmlbx
Private Sub lbxLimits_LostFocus()
Dim strSelected As String
Dim varSelected As Variant
For Each varSelected In Me.lbxLimits.ItemsSelected
strSelected = strSelected & _
Me.lbxLimits.Column(1, varSelected) & vbCrLf
Next varSelected
txtLimitsFrmlbx.SetFocus
txtLimitsFrmlbx.Text = strSelected
End Sub
Thank you for any ideas,
Karl