Solved

Choose multple records when using a drop-down-list on an Access form

Posted on 2008-10-16
9
253 Views
Last Modified: 2013-11-28
I currently use a combo box where the user can select from a list and the selection is eneterd into the combo box. I then use this information for further processing. I would like to have the user select more than one choice from this list. Example: I have a location list as the drop-down and the user wants to run a report for both NY and NJ. I'd like the user to be able to hightlight both these choices and for me to capture this info so I can process the data for both locations.
Doc4.doc
0
Comment
Question by:arnier13
  • 4
  • 3
9 Comments
 

Expert Comment

by:doitforstudents
ID: 22735612
I would suggest using a list instead then, it will allow you to select multiple values.
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 22735625
set the Multi Select property of the list box to Simple or extended
0
 

Author Comment

by:arnier13
ID: 22735650
Yes, I tried that, but I'm not sure how the user selects more than one item.
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 22735717
what do you have so far in processing your report?
0
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 

Author Comment

by:arnier13
ID: 22735746
Ok, I set it up with the "simple" multi select. I now need to look at list0 to determine exactly how it stores the multiple selections. I will be using a set variable routine:
i = GP_GetSetVariable("Set", 90, Me![List0])

Then I can look at gp_getsetvariable("get",90,null)
0
 

Author Comment

by:arnier13
ID: 22735929
I'm not sure how the selection information is stored in a list box when Multi Simple is chosen. I can look at the data in a combo box, but nothing appears when I check the data in the list box.
0
 

Author Comment

by:arnier13
ID: 22736130
I'm using a text box to display the information in the list box.
Text4 = List0
When I have Multi=No the form displays the choice from List0 in Text4 - It works

When I change the property to Multi=Yes Simple - Nothing displays in Text4
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 22740310
to display items selected form the listbox to Text4, separated by comma

private sub cmdBtn_click()
dim j, sLst
with me.list0
        If .ItemsSelected.Count > 0 Then
        for Each j In .ItemsSelected
            sLst = sLst & "," & .ItemData(j)
               
        next
        end if
end with
sLst = Mid(sLst, 2)
Me.text4 = sLst

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now