I've finished my customer database program EXCEPT one last thing.

I got to add products to database field from listbox by putting product names in string variable (ie. strCustom = APPLE LW SELECT360 TONER (OEM), BROTHER MFC2800 PRINTER (Reman.))

but then I want to reverse it back, so when user wants to edit the product list from the listbox, he/she can pick individual ones.

from APPLE LW SELECT360 TONER (OEM), BROTHER MFC2800 PRINTER (Reman.)

to

APPLE LW SELECT360 TONER (OEM)
BROTHER MFC2800 PRINTER (Reman.)


VB Code:
  1. Dim strTempCustom As String
  2.         Dim strTempCustom2 As String
  3.         Dim pos As Integer
  4.        
  5.         rsCustomer.FindFirst "CompanyName= " & Chr(34) & cdTempCustom.strCompany & Chr(34)
  6.        
  7.         strTempCustom = rsCustomer!Products
  8.        
  9.         pos = 1
  10.            
  11.             Do While InStr(pos, strTempCustom, ",")
  12.                 pos = InStr(pos, strTempCustom, ",")
  13.                 lstProduct.AddItem Mid(strTempCustom, pos + 1, InStr(pos, strTempCustom, ",") - pos)
  14.            
  15.             Loop

my friend me gave me this code, but it just loops infinitely.

I'm not used to using Instr function..

any help would be appreciated, thank you