troubleshooting Question

Problem returning selected items in list box in Access

Avatar of NashVegas
NashVegasFlag for United States of America asked on
Microsoft Access
21 Comments1 Solution374 ViewsLast Modified:
I have a form with a list box control called ppe_req. The user selects one or more items from the list and then clicks a button that opens a word template and populates the document with information from the form. Everything works except the data coming from the list boxes. Access ignores the selected items and returns an empty string when the loop is executed below. If I use the immediate window and type in ?me.ppe_req.itemsselected.count, I get 0 even though there are 5 items selected in the list. What am I missing?
i = 0
Do Until IsNull(Me.ppe_req.ItemData(i))
    If Me.ppe_req.Selected(i) Then
        strPpe_req = strPpe_req & Me.ppe_req.ItemData(i) & vbCrLf
    End If
    i = i + 1
Join our community to see this answer!
Unlock 1 Answer and 21 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 21 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros