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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save Multiple Listbox choices to a memofield 1

Status
Not open for further replies.

teering

Programmer
Nov 4, 2002
30
US
I would like to save the multiple choices from a listbox
into a memofield - i am using the following code but it
will only save the last selection -- does anyone know what i need to do? or is there a better way to save the choices to a table - thanks in advance, using vfp 7
LOCAL ncount
SELECT table1
APPEND BLANK
FOR ncount = 1 TO thisform.lstchkbox1.ListCount
IF thisform.lstchkbox1.aselected(ncount)
replace table1.fld1 WITH thisform.lstchkbox1.value
endif
ENDFOR

Teresa Pickering
Professional Computer Services
 
Try
Code:
LOCAL ncount,m.string
SELECT table1
APPEND BLANK
m.string = ""
FOR ncount = 1 TO thisform.lstchkbox1.ListCount
 IF thisform.lstchkbox1.aselected(ncount)
    m.string = m.string + iif(!empty(m.string),chr(13)+chr(10),"")+thisform.lstchkbox1.value
 endif  
ENDFOR 
replace table1.fld1 WITH m.string



Regards

Griff
Keep [Smile]ing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top