Solved

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

Posted on 2008-10-16
9
255 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 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
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 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

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…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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 …

777 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