Hi Devi,
I assume you are using lists based on a file or query.
I have never used listboxes for deleting records, so I don't know if like browsing tables records are automatically deleted by listdelete. (don't think so)
As for your code:
ListSelect returns the subscript of a list, not the recordnumber.
hRecNum without a file name returns the recordnumber of the file last used by a h function. I think you'd better use hRecNum with a filename as parameter (in all cases).
If you still want to delete records from a listbox, a solution could be to use a memory list.
In the details tab of the list check the "returns the value specified woith glink" option.
for all MyFile on MyKey
ListAdd(MyList,MyFile.MyField+gLink(hRecNum(MyFile))
end
gLinkActivate(MyList)
Now MyList or MyList[subscript] returns the recordnumber.
HTH, best reagrds,
Piet