+ Reply to Thread
Results 1 to 3 of 3

ListView syntax help.

Hybrid View

  1. #1
    Registered User
    Join Date
    01-29-2013
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    68

    ListView syntax help.

    Hi all,

    With frmView!ListView1.ListItems(frmView!ListView1.SelectedItem.index)
    
            .SubItems(5) = "Paid"
            .SubItems(5).ForeColor = RGB(0, 255, 0)
        End With
    This puts "Paid" into column 5, but it gives object required error on forecolor change.


    This works when I populate ListView1


                   .ListItems(j).ListSubItems.Add , , Format(Format(myNewArray(i, 7), "###,##0.00"), "@@@@@@@@@@@@@")   'Amt.Due
                    If Val(myNewArray(i, 13)) < 100 Then
                        .ListItems(j).ListSubItems.Item(4).ForeColor = RGB(255, 0, 0)
                    End If
    How did I foul this up?

    Thanks

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: ListView syntax help.

    perhaps
    .ListSubItems.item(5).ForeColor = RGB(0, 255, 0)
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    01-29-2013
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: ListView syntax help.

    Thanks Joseph, that did the trick.
    I thought I had tried that.

    It is odd though, it didn't require that to change the value, but it does to change a property.
    thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1