Solved

Each Item Selected in listbox

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

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

910 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

22 Experts available now in Live!

Get 1:1 Help Now