?
Solved

datacombo box -> choosing more than one value?

Posted on 2000-04-25
3
Medium Priority
?
211 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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month10 days, 17 hours left to enroll

770 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