4 Replies Latest reply: Oct 27, 2008 3:55 AM by (Isaac_Arthur) RSS

    Change color of row in ListBox

      We use Adobe Workflow Designer v. 5. Users type data into various fields on a page in a form and when they click an Add button, the fields are added as a record to the List Box. It is a method that was used when we had someone create a New Client Matter form for us and we like this method.

      I am using this method on a new form, a Check Request form. We would like to be able to change the color of a row in the List Box based on whether the client has outstanding AR > 90 days, for example.

      I have looked through alot of the sample forms but I haven't seen how to change the color of a row in a List Box. Is it possible?

      Thanks much!
      Mary
        • 1. Re: Change color of row in ListBox
          Mary - The Adobe Form listbox object does not have this capability.
          • 2. Re: Change color of row in ListBox
            Community Member
            Jon,

            thanks for getting back to me. I thought that was the case so I have worked out something else. I place a row into a new list box, which is red, if the item meets the criteria. I have that working fine but am now looking at how I can delete an item from that list box if the user deletes the item from the main list box. We use the Add, Delete, Clear buttons/code you're probably familiar with since we had Elite develop our first New Client Matter form.

            I added some code to the delete button to determine if the client record to be deleted meets the criteria and if so, then to go to the other list box, locate the row and delete it. I am wondering if I need to somehow change the focus to that list box. Focus is on the main list box because the user selects the record in the main list box and then clicks the Delete button. I have tried alot of different things to delete the row in my 2nd list (you will see all of the commented out items). I have noted the beginning and end of the 'problem code' with comments. I have included all of the code for this section. lstExp is main list box, lstOutARUnbilled is the other list box.

            If (lstExp.CurrentSelection <> 0) then
            strlist = Trim(Expholder.text) & Trim(ExpDate.Text) & ";" & Trim(Purpose.Text) & ";" & Trim(Category.Text) & ";" & Trim(clnum.text) & ";" & trim(clname2.text) & ";" & trim(GenLedger.Text) & ";" & trim(CostCodeName.Text) & ";" & trim(CostCodeCode.Text) & ";" & trim(ExpDesc.Text) & ";" & trim(Amount.text)

            clientnum = ""

            if Amount.Text > 1000 and Purpose.Text = "Client Charge" then
            szSQL = "Select sum(arage4+arage5) from dw_dailyar where (mmatter = '" & trim(clnum.text) & "'" & " and fco = 'F') or (mmatter = '" & trim(clnum.text) & "'" & " and fco = 'C')"
            fresult1 = WFDataClient.ConvertResultSetToSingleString(WFDataClient.ExecuteScalarWithConnName(szSQL, Global.gConnWFDC))

            szSQL = "Select sum(wipfees4+wipcosts4) from dw_dailyubtc where (mmatter = '" & trim(clnum.text) & "'" & ")"
            fresult2 = WFDataClient.ConvertResultSetToSingleString(WFDataClient.ExecuteScalarWithConnName(szSQL, Global.gConnWFDC))

            fresult = fresult1 + fresult2

            if fresult <> "" then
            if fresult > 0 then
            'have determined in lstOutARUnbilled list
            'now determine if another record in lstexp with same cm# which is >1000
            'if so, leave in list, if not delete from lstOutARUnbilled

            For irow = 1 to lstExp.ListCount
            clientnum = lstExp.RetrieveItem(irow,4)
            if clientnum = trim(clnum.text) then
            if lstExp.RetrieveItem(irow,10) > 1000 then

            DeleteOutARYes = "Y"
            else
            DeleteOutARNo = "N"
            end if
            end if
            Next
            if DeleteOutARNo <> "N" then
            'forms.controls.item(lstOutARUnbilled).ActiveControl.Name

            'start of problem code

            For irow2 = 1 to lstOutARUnbilled.ListCount
            if clientnum = lstOutARUnbilled.RetrieveItem(irow2,1) then
            iindex= lstOutARUnbilled.CurrentSelection
            'iindex = lstOutARUnbilled.RetrieveItem(CurrentSelection)
            lstOutARUnbilled.Removeitem (iindex)

            'iindex = lstOutARUnbilled.CurrentSelection
            'iindex = lstOutARUnbilled.RetrieveItem(irow,1)
            'lstOutARUnbilled.Retrieveitem(iindex)
            'lstOutARUnbilled.RemoveItem
            'lstOutARUnbilled.Selected(iindex)
            'lstOutARUnbilled.RemoveItem(iindex)
            end if
            next

            'end of problem code

            end if
            end if
            if lstOutARUnbilled.ListCount = 0 then
            lstOutARUnbilled.Visible = False
            txtoutstandingAR.Visible = False
            end if
            end if
            end if
            end if

            Thanks!!!
            • 3. Re: Change color of row in ListBox
              Dear Mary,

              I would appreciate any help you can give me with this. I have asimilar problem to your origional query.
              I have a list of names in Excel.
              I then have a User Form that calls the list from Excel into a List Box in the User Form.
              I want to highlight some of the names in the list, so that Users can know which ones to select from the list when they open the User form.

              Thank you
              Nana
              • 4. Re: Change color of row in ListBox
                Hi Nana,
                I have several forms in which I populate list boxes, but I load from SQL tables. I use a selection criteria to determine which rows from the SQL table should be in the list box. That eliminates the need to highlight specific rows. The list box contains a subset from the SQL table and any row in the list box may be selected.