Advertisement

05.29.2008 at 02:26PM PDT, ID: 23443020
[x]
Attachment Details

Need to read the columns of a selected listbox row.

Asked by Dovberman in Access Forms, Microsoft Access Database, Visual Basic Programming

Tags: , ,

I have a 4 column listbox which is populated from a recordset.

I can locate the index of the selected row.

What is the syntax for reading the value of one of the columns?

Private Sub cmdSelect_Click()  ' The listbox click event does nothing. I added this button to
detect the selected row.

   Dim intCtr As Integer
   Dim isSelected As Boolean
   Dim intStop As Integer
   intCtr = 1
   
   For intCtr = 0 To lstApplicants.ListCount - 1
        isSelected = lstApplicants.Selected(intCtr)
        If isSelected Then
            intStop = 8
            lstApplicants.ItemData (intCtr) ' returns the data from column 0
            ' ??? Return the value from column 1, col 2, etc.
             Exit For
        End If
     Next
End Sub

Thanks,
Start Free Trial
 
Loading Advertisement...
 
[+][-]05.29.2008 at 02:33PM PDT, ID: 21673482

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Forms, Microsoft Access Database, Visual Basic Programming
Tags: Microsoft, access 2003, Standard
Sign Up Now!
Solution Provided By: jimhorn
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628