Hi All,
I’m trying to use the multi-select property on a list box, but… I want to limit the number of selections to seven. I’ve been trying to use the following….
Private Sub IndexAccount_BeforeUpdate(Cancel As Integer)
[tab]Static indexAccountSelected(0 To 7) As Long
[tab]indexAccountSelected(IndexAccount.ItemsSelected.Count - 1) = ????
[tab]If IndexAccount.ItemsSelected.Count = 7 Then
[tab][tab]IndexAccount.Selected(IndexAccount.ItemsSelected(7)) = False
[tab][tab]Cancel = True
[tab]End If
End Sub
I’m stumped & I didn’t see it in Access help or in the Tek-Tips FAQs or history. Grrrrr! OK, I’m a newbie to VBA but I gotta learn sometime.
I’m trying to use the multi-select property on a list box, but… I want to limit the number of selections to seven. I’ve been trying to use the following….
Private Sub IndexAccount_BeforeUpdate(Cancel As Integer)
[tab]Static indexAccountSelected(0 To 7) As Long
[tab]indexAccountSelected(IndexAccount.ItemsSelected.Count - 1) = ????
[tab]If IndexAccount.ItemsSelected.Count = 7 Then
[tab][tab]IndexAccount.Selected(IndexAccount.ItemsSelected(7)) = False
[tab][tab]Cancel = True
[tab]End If
End Sub
I’m stumped & I didn’t see it in Access help or in the Tek-Tips FAQs or history. Grrrrr! OK, I’m a newbie to VBA but I gotta learn sometime.