Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show Highlighted items in list box

Status
Not open for further replies.

RITec

MIS
May 15, 2002
98
0
0
US
This should be a simple question. (At least I hope it is).

I have created a form to display other info and two (simple) list boxes.

When I create a record you can select multiple items and it stores it in the record.

When I come back to that record the selected items are not highlighted if there is more than one selection.

I created a text box to show the information has in that field, and the record shows the numbers.

Tried on current list box = text box(record, etc) again only works if one selection was made.

Tried changing the row source to different things and at one point it would show only the selected items.

I need to show all items in list box and highlight only items saved in record.

Thank you for your time.
Ritec
 
Is the listbox MultiSelect ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi PHV

Sorry for not giving more information the first time. And for response time. (Monday’s are always hectic).


I have multi select to simple

I have this in a module
Code:
Sub lbSave(ctlLB As Control, ctlBound As Control)
   Dim MyList, i
   MyList = Null
On Error GoTo Err_mslbSaveList
   For Each i In ctlLB.ItemsSelected
      MyList = MyList & ";" & ctlLB.ItemData(i)
   Next
   If Len(MyList) > 0 Then MyList = Mid(MyList, 2)
   ctlBound = MyList
Bye_lbSave:
   Exit Sub
Err_mslbSaveList:
   Beep
   MsgBox Error$, 16
   Resume Bye_lbSave
End Sub

I have this in list box after_update
Code:
lbSave Me![List4], Me![Field Name]


This seems to work great for storing the information.

I cannot figure out how to read the information once it is in the file.

I am thinking that something should be place in the on current event
Just cannot figure it out. I tried to make the criteria equal [Table2]![field name]

I though about creating a var or array (maybe a sub or a function) to separate the Items. But not having much luck


Thanks
RITec

 
How are ya RITec . . . . .

If I have this right; you have a multiselect ListBox, from which you populate certain controls on the form (including the two textboxes). The record is saved and when you goto another record and come back, you are expecting the same multi-select secnario to be highlighted?

Is that correct?

cal.gif
See Ya! . . . . . .
 
That is correct

I don't need the text box I just shows me that there is data in that field.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top