Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Each Item Selected in listbox

Posted on 2007-12-05
2
Medium Priority
?
716 Views
Last Modified: 2013-11-28
I have a listbox that I want to cycle through.  When i cycle through I want to have the user input a value in an inputbox and perform an action.  

My question is that in order to do this I need data from an unbound column in the listbox.  Here is my code sor far:
Private Sub cmdReceiveItem_Click()
 
Dim varItm As Variant
Dim varReceieveAmount As Integer
 
For Each varItm In Me.lstParts.ItemsSelected
 MsgBox Me.lstParts.ItemData(varItm)'Works fine for each item selected
   'MsgBox Me.lstParts.Column(2) 'This just returns the last item selected
 
   varReceieveAmount = InputBox("How many items are you receiving for" & Chr(13) & "Part - " & Me.lstParts.Column(2) & " - " & Me.lstParts.Column(3) & "") ' This obviously has the same issue with only having data for the last item selected in listbox
   
Next
End Sub

Open in new window

0
Comment
Question by:Lasers07
[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
2 Comments
 

Accepted Solution

by:
Lasers07 earned 0 total points
ID: 20416457
ahh... nevermind.  I figured it out.

MsgBox Me.lstParts.Column(2, varItm)
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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.

636 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