Use the listbox's Change event. You can tell if the "*" is selected by using
the ListIndex property. If the selected item is "*", then set the
MultiSelect property to 0. Now, the trick is, what if a user selects items
other than * first,then goes back and selects the *?
> I have a listbox based on a table and I want the user to be able to either
> select the first item which is a * OR make multiple selections from the list.
> If the * is selected then the user should not be able to make other
> selections.
>
> Thanks
Douglas J Steele - 31 Jan 2006 18:03 GMT
Sorry, Klatuu, but I don't think that'll work.
From the Help file entry for MultiSelect property "This property can be set
only in form Design view."
I think the only solution is to put logic in the list box's BeforeUpdate
event:
Private Sub MyListbox_BeforeUpdate(Cancel As Integer)
If Me.MyListbox.ItemsSelected.Count > 1 Then
If Me.MyListbox.Selected(0) = True Then
MsgBox "Can't select * with any other values"
Cancel = True
End If
End If
End Sub

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> Use the listbox's Change event. You can tell if the "*" is selected by using
> the ListIndex property. If the selected item is "*", then set the
[quoted text clipped - 7 lines]
> >
> > Thanks
Klatuu - 31 Jan 2006 18:20 GMT
You are correct, Douglas. Sorry, I forgot about that.
> Sorry, Klatuu, but I don't think that'll work.
>
[quoted text clipped - 28 lines]
> > >
> > > Thanks