General information
Category:
Coding, syntax & commands
Hello Dragan, i am really sorry. It is not deleting the list item from list box please help.
because in the database table there is a record which matches the criteria but it is not really deleting.
for the list box property Row source has the following in it:
workpkgtask_view.project_no,workpkg_no,task_num,task_desc
how can i trim all the values whichever appears in the list box.before i click delete.
because all the values are coming from the view so the value actually in the view is "112 " with space but in the select query which is used for delete in it the values appearing"112" with no space so i assume that is the reason why it is not deleting.
**********Following is the code i am using*************
THISFORM.mousepointer = 11
local cListTable
cListTable = "WorkpkgTask_View"
select (cListTable)
lCount = thisform.list1.listCount
WAIT WINDOW "Scanning for records to delete" NOWAIT NOCLEAR
FOR cnt = 1 TO lCount
IF INKEY() = 27
EXIT
ENDIF
IF thisform.list1.selectedId(cnt)
thisform.list1.selectedId(cnt) = .f.
SELECT (cListTable)
LOCATE FOR project_no = thisform.list1.listItem(cnt,1) AND Workpkg_no = thisform.list1.listItem(cnt,2)
DELETE
ENDIF
ENDFOR
WAIT CLEAR
thisform.list1.requery
thisform.list1.refresh
thisform.list1.setfocus
thisform.mousepointer = 0
*************************END*****************
Thank you Very much.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only