Solved

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

Posted on 2008-10-16
9
254 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
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 …

912 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

20 Experts available now in Live!

Get 1:1 Help Now