Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

How can I change a Cell of a List View

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lina Manjarres - 05 Jan 2006 21:16 GMT
I have a list view that I would like to change the data of a cell by
celecting the cell.
This is what I have, but it always return me column 0

Public Function GetRowColumn(ByVal Item As MSComctlLib.ListItem) As String

Dim ColH             As ColumnHeader
Dim Index            As Long

For Each ColH In ListView2.ColumnHeaders
     If Col > (ColH.Left + ListView2.Left) And Col < (ColH.Left +
ListView2.Left + ColH.Width) Then
        'Found the column
        Index = ColH.Index
        Exit For
     End If
  Next
GetRowColumn = "Row:" & Item.Index & "  Column:" & Index
End Function

Private Sub ListView2_ItemClick(ByVal Item As Object)
MsgBox (GetRowColumn(Item))
End Sub

Private Sub ListView2_MouseDown(ByVal Button As Integer, ByVal Shift As
Integer, ByVal x As Long, ByVal y As Long)
   Col = x
End Sub

Thanks a lot, Lina
Alex Dybenko - 06 Jan 2006 10:32 GMT
Hi Lina,
perhaps you can better explain what do you mean by "change the data of a
cell by selecting the cell"
you can get selected listitem using .Selected property

Signature

Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

>I have a list view that I would like to change the data of a cell by
> celecting the cell.
[quoted text clipped - 26 lines]
>
> Thanks a lot, Lina
Lina Manjarres - 06 Jan 2006 17:00 GMT
Hi Alex
I have a treeview, and I want the user to be able to change a data, just by
picking the cell and writing something in. Is it posible? Or what would be
the way to do so, because I have a table like this:

2005   1
2006   2
2007   8
2008   10 and so forth

But I want the user to see ti as this:

2005    2006   2007   2008
 1           2        8       10

and then the user make a click on the 1 and be able to change it to 8 or
whatever...

I hope i am making myself clear, am I?

Thanks a lot, Lina

> Hi Lina,
> perhaps you can better explain what do you mean by "change the data of a
[quoted text clipped - 31 lines]
> >
> > Thanks a lot, Lina
Alex Dybenko - 07 Jan 2006 10:05 GMT
Hi Lina,
for treeview you can set LabelEdit property to automatic, this will allow
user to edit node text directly in treeview, and then you can use
BeforeLabelEdit event to update table with data entered

Signature

Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

> Hi Alex
> I have a treeview, and I want the user to be able to change a data, just
[quoted text clipped - 55 lines]
>> >
>> > Thanks a lot, Lina
Lina Manjarres - 07 Jan 2006 15:20 GMT
I am so sorry Alex, I made a mistake, I was talking about listview, not
treeview.

> Hi Lina,
> for treeview you can set LabelEdit property to automatic, this will allow
[quoted text clipped - 60 lines]
> >> >
> >> > Thanks a lot, Lina
Alex Dybenko - 08 Jan 2006 15:06 GMT
Hi Lina,
you can do he same in listview, if also has same property and event

Signature

Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

>I am so sorry Alex, I made a mistake, I was talking about listview, not
> treeview.
[quoted text clipped - 68 lines]
>> >> >
>> >> > Thanks a lot, Lina
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.