Solved

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

Posted on 2008-10-16
9
256 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

860 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