?
Solved

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

Posted on 2008-10-16
9
Medium Priority
?
259 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
[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
  • 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22735717
what do you have so far in processing your report?
0
 

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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

764 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