How to return Selected Row information from DBGrid back to calling form when DBGrid filtered with SQL?
Posted on 2004-09-26
I have a search form which allows a "Select *" type SQL statement to be performed on a table when first opened.
The intent is for the user to be able to filter the SQL statement further, and then to return the selected item back to the calling form, in order to be able to update that form, or alternatively to review details (based upon the selected item).
So far so good - I have the filter and the search form going well
The problem that I have is when I want to select that record and review it in the calling form, or use the information to update the calling form.
I've tried using RecNo, but that will only give me the correct record associated with the unfiltered search.
If I filter the search, RecNo could well be for example, the ninth record overall, but only the second record when filtered. The result returned to the form is the second record overall.
How can I get this item to perform for me, so that as per the example: the second filtered record on the DBGrid is returned as the correct ninth record overall to the calling form?
thanks in Advance