Solved

How to get lstWs.Comlumn(1) value...

Posted on 2008-10-28
5
180 Views
Last Modified: 2013-11-27
   For i = 1 To Forms!fFiles!lstWs.ListCount - 1
        If Forms!fFiles!lstWs.Selected(i) = True Then   '<--- if selected
            Debug.Print Forms!fFiles!lstWs.ItemData(i) '<-- this gives the value of 1st column ok.
            Debug.Print Forms!fFiles!lstWs.Column(1).Column(1) '<-- this fails
        End If
    Next i

Question: What is right syntax for

Debug.Print Forms!fFiles!lstWs.Column(1).Column(1)

Thank you.
0
Comment
Question by:Mike Eghtebas
[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
5 Comments
 
LVL 46

Expert Comment

by:tbsgadi
ID: 22820527
Hi eghtebas,

Maybe Debug.Print Forms!fFiles!lstWs.Column(1)
Depends waht you want to see.


Gary
0
 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 150 total points
ID: 22820532
Forms!fFiles!stWs.Column(i, 0)

But I gotta say this: If this is Mike posting - this is elementary Access 101 ... a rather odd question for a Genius in the Access TA.

0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 22820601
Hi Gary,

I want to see the second column of the for the selected row (item)

No      Name
1          A
2          B    '<-- if this row is selected,  Forms!fFiles!lstWs.Selected(i) = True
3         C

Then I want th value of B.

Hi LSMConsulting,

But I am not able to get the right value yet. Maybe becuase it is 5 am here.

Forms!fFiles!stWs.Column(i, 0)    gives me null
Forms!fFiles!stWs.Column(i, 1)    also gives me null

Mike


0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22821134
it should be the other way around

Forms!fFiles!stWs.Column(0,i)    
Forms!fFiles!stWs.Column(1,i)    
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 350 total points
ID: 22821191
typo

Forms!fFiles!lstWs.Column(0,i)
Forms!fFiles!lstWs.Column(1,i)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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.
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…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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.

691 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