Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2005

    Unanswered: Populate Extra Column in List Box

    Hi I was just curious if you could place a value in a third column of a listbox item. I have a form that highlights the records that have already been selected and I want to put a string value and possible a hyperlink.

    For example

    list box

    First column , Primary Key, hidden
    second column Name, visible
    third column either Add or Delete based on if the item is selected.

    Hello Add
    Goodbye Delete

    I have the code that hightlights the selected items just need to see how I can add the data in the third column

    'code to highlight selected records in list box
    With rslstBox
    Do While Not rsList.EOF
    .FindFirst "[Change Type ID] =" & rsList.Fields(0)
    lngID = .AbsolutePosition
    frmName.Change_Type_ID.Selected(lngID) = True
    End With
    Last edited by asalamay; 03-05-08 at 10:41.

  2. #2
    Join Date
    Nov 2007
    Adelaide, South Australia
    Hi I was just curious if you could be a value in a third column of a listbox item.
    No thanks, I'm happy being a human being ^^
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!

    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    its a technique that works if you don't have a large amount items int he listbox, you have a slow network and so on...

    it can be quite useful to pull several items in one hit, rather than having to do several dlookups or open a recordset.

    however be warned its only appropriate for a few occasions
    where the data you want to retrieve is static... ie it isn't going to change over time. storing data in the list box is ok but it only gets populated at the time the form loads, or if you refresh the control, so there is a risk that the data may be out of date.

    its not appropriate for large amounts of data... each and every element you store in the control requires memory, ok in these days of multi GB Ram & pagefiles/vm its less of a problem. its not a good idea if the form is used for a short time, you spend a lot of time loading the form, populating the list/combo box and then close it after a few uses.

    it doesn't scale too well to other SQL engines, other than JET. populating combo boxes is something that can be a real resource hog in server db's. not because of any signifdicant problem.. just that you are trucking a lot of data around the network, which is of limited use. Arguably big recordsets may be better handled by partial loads of combo.listboxes, based on what the user types (eg if they type A load all customers starting with A)

    Ive used the technique to store a series of values, due primarily the network being clogged and very very slow.. it worked a treat. but you could get the same effect by storing copies semi static values at runtime.. ie create local copies of the tables when the application first opens.


  4. #4
    Join Date
    Mar 2005
    So I have have 4 values that are returning in the list box, and currently I have the code to highlight the selected values. But I want a hint on how to put a Hyperlink in a 3rd column of the list box. if the item was selected it would the string in the 3rd column would say Delete and if not selected it would say Add.

    I have tried to use the .column method of the list box but I can only figure that it is to read data and now add it. Is there another way to add data to a column?

Posting Permissions

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