thank you for your help.
I tried the way you have told, but I still have a problem.
If you can take a look at this, I will appreciate it.
this is what I did:
FOR nCnt = 1 TO ThisForm.selectedlist.ListCount
ThisForm.selectedlist.SelectedID(nCnt) = .t.
ENDFOR
CREATE CURSOR SQL_Sem (sem_Names C(25))
for i = 1 to thisform.selectedlist.listcount
INSERT INTO SQL_Sem (sem_Names);
VALUES (thisform.selectedlist.ListItem(i))
endfor
select all a.cid, a.cname, b.csemester, b.ccourse, b.ccouroff, b.cstudent from sys_mast a, enroll b where a.cid = b.cstudent and rtrim(b.csemester) in (select thisform.selectedlist.value from SQL_Sem) into dbf c:\attend\temp
right now, it is giving me an error in the last line
this line : (select thisform.selectedlist.value from SQL_Sem)