?
Solved

Each Item Selected in listbox

Posted on 2007-12-05
2
Medium Priority
?
715 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

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