Solved

Each Item Selected in listbox

Posted on 2007-12-05
2
708 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
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
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 the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

21 Experts available now in Live!

Get 1:1 Help Now