Displaying multiple selections from areport in a table

  • Thread starter Thread starter dungyc
  • Start date Start date
D

dungyc

Guest
Hi,

i am a complete beginner so you may have to walk me through this very slowly - small words, and simple sentence structure!

I have a form that has listbox (called description) which allows respondants to select the 3 words that best describe them.

Question 1:

Can I limit the number of selections to 3?
If so, How?

Question 2:
How do I get the selected 'descrptions' to display in the table it is bound to?

As all I get presently is a blank box.

Thanks
 
I'm pretty sure there is no easy way to do what you're talking about. Look into the listbox control's 'selected' property. You'll have to loop through all of the items in the listbox & check the selected property of each(if it's highlighted it'll be = true).

Good luck. i'm sure you'll find plenty of sample pieces of code to do this.

norm

[This message has been edited by norm (edited 11-28-2000).]
 
Hi
You could use the count of itemsselected property of the list box.

Just use the BeforeUpdate event and cancel the update if the count is more then 3.
(The user will not be able to move the focus from the contral until only three items selected)

Private Sub lbDescription_BeforeUpdate(Cancel As Integer)
Static i As Integer
If Me.lbDescription.ItemsSelected.Count > 3 Then
MsgBox "You cannot select more then 3 itmes!"
Cancel = True
End If
End Sub

Good Luck!
 

Users who are viewing this thread

Back
Top Bottom