Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

datacombo box -> choosing more than one value?

Posted on 2000-04-25
3
Medium Priority
?
212 Views
Last Modified: 2010-05-02
I have data combo box
let say table persone  wich has 2 field code and name
in my program i have combo box that shows the name
when a person select the name it stores the code in database.

Is there a way with datacombo to select more than one value.
I want to be able to select 2 or 3 persones and store their code in database
Did any of you guys encounter this before???

can you give me small code example for 50 points?
0
Comment
Question by:jerbell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
scj1 earned 150 total points
ID: 2747994
The data combo only allows single selections. However, using the normal list control with the multi-select property set to True will allow mutliple selections.

The data list doesn't support multiple selections because it is designed to be bound to a single field (the bound column).

I hope that helps. Incidently, using the onClick and onSelectionChange events you can effectively create the same sort of illusion as data binding (obviously via use of a recordset object) - use the itemData value to store the data you want to bind.

I hope that helps somewhat...

Cheers,

StuJ
0
 
LVL 1

Expert Comment

by:scj1
ID: 2748016
Oh, code:
'init listbox
private sub initListBox
 list1.multiselect = true
 with rs 'recordset
  do while not .eof
    list1.additem !itemNameField
    list1.itemData(list1.newIndex) = !itemDataToBind
    .moveNext
  loop
 end with
end sub

'Event
Private Sub List1_Click()
  dim i as integer
  for i = 0 to list1.listcount -1
   if list1.selected(i) then
     'appropriate code to say this is
     'selected
   end if
  next i
End Sub
0
 

Author Comment

by:jerbell
ID: 2748047
thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question