Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / January 2004

Tip: Looking for answers? Try searching our database.

How to select multiple frm drop dn list?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andreea - 22 Jan 2004 22:25 GMT
do you know if there is a way to select multiple items
from a drop down list (like using the ctrl or shift key)
for a particular column and have them associated (stored)
with that row in the table? (verses just one item from the
list being stored for that particular column in that row)
The source type is Table/Query. Row Source is from a
column in the querried table.
Immanuel Sibero - 22 Jan 2004 23:35 GMT
Hi Andreea

A listbox has a property called "MultiSelect". If you set this property to
Extended, you will be able to select multiple items in that box with using
Ctrl or Shift. But this is not the end of the story. Access does not
conveniently combine or concatenate the result for you, you would have to
loop through each selected item and do something with it.

Below is an example of a form called SomeForm and a listbox within that form
called SomeListBox (aircode - just off the top of my head to give you an
example). The example goes through each selected item and simply combine
(concatenate) them.

   Dim frm As Form, ctl As Control
   Dim varItm As Variant
   Dim varSelectionResult as Variant

  Set frm = Forms!SomeForm
  Set ctl = frm!SomeListBox

  For Each varItm In ctl.ItemsSelected
       varSelectionResult = varSelectionResult  & ctl.ItemData(varItm)
  Next varItm

  ....   do whatever you need with varSelectionResult

That said, I have to bring up table normalization. Needing multiple values
in a column for a row suggests an unnormalized table which will create
problems. In a normalized table, you should only find ONE value at an
intersection between a column and a row.

HTH,
Immanuel Sibero

> do you know if there is a way to select multiple items
> from a drop down list (like using the ctrl or shift key)
[quoted text clipped - 3 lines]
> The source type is Table/Query. Row Source is from a
> column in the querried table.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.