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:
Dim strTempCustom As String Dim strTempCustom2 As String Dim pos As Integer rsCustomer.FindFirst "CompanyName= " & Chr(34) & cdTempCustom.strCompany & Chr(34) strTempCustom = rsCustomer!Products pos = 1 Do While InStr(pos, strTempCustom, ",") pos = InStr(pos, strTempCustom, ",") lstProduct.AddItem Mid(strTempCustom, pos + 1, InStr(pos, strTempCustom, ",") - pos) 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




Reply With Quote