Results 1 to 3 of 3

Thread: [RESOLVED] show value in the listbox

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Resolved [RESOLVED] show value in the listbox

    I use 2 listbox. One listbox show the field names and another listbox show the values.It work and show me the value for that field if only one field name is selected from listbox1.It.[CODE]But when more then one field name is selected from listbox1, It show me only one value in the listbox2. It suppose show me 3 difference value for difference field name.Why it show me only one value despite I have selected three field name from the listbox1 ?

    Code:
    If List1.ListIndex > 0 Then
    For j = 0 To List1.ListCount - 1
    If List1.Selected(j) = True Then
    List2.AddItem fld.Name & ": " & fld.ValueAsString
    End If
    
    Next j
    End If
    Attached Images Attached Images  
    Last edited by matrik02; Jul 21st, 2007 at 08:56 AM.

  2. #2

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: show value in the listbox

    you need to find the correct record to return the field name & value for each item selected
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

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



Click Here to Expand Forum to Full Width