Solved

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

Posted on 2008-10-28
5
178 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
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 84

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

808 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