On Tue, 21 Dec 1999, Yu, Ken wrote:
> Why don't you just store the record index somewhere (eg a hidden array)
> when you ran the query and pass it back to delete?
>
> DmQueryNextInCategory() passes back the index as one
> of its paremeters. Is this how you are retrieving your
> records?
This requires some sort of loop to get the index. I know how to do it
the really hard way. I am looking for an easy way that does not
require a loop.
For instance, I know I can do a for() loop using DmQueryNextInCategory
and see if it is the right record, then use that index. But that is
very costly.
There must be an easy way to retrieve the index of an item in a list
that cooresponds to the item number in a category that can be used to
get the index in the database. For instance, if my list has all items
in a selected category, then list item 3 is the third in a category
which cooresponds to ??? index in the database.
Someone suggested DmSeekRecordInCategory() but I'm not sure that does
it. I guess I will have to play with it and see if that works.
Mike
> -Ken
>
> > ----------
> > From: Michael S. Davis[SMTP:[EMAIL PROTECTED]]
> > Reply To: [EMAIL PROTECTED]
> > Sent: Tuesday, December 21, 1999 10:56 AM
> > To: [EMAIL PROTECTED]
> > Subject: Still no answer - Index of Selected item in Category
> >
> >
> > I still need a solution to this problem. I want to be able
> > to delete a record that is displayed in a list that is displayed
> > on a form. The list contains items within a category.
> >
> > So there might be 4 items in the list because there are only
> > 4 items within a specific category.
> >
> > When I select item 3, for instance, I want to delete that item
> > from the database. But I need the index, within the database, to do
> > that. And the index might be 100, or 30 or who knows what.
> >
> > The only function that I see that is close is DmPositionInCategory() but
> > that appears to return the position in the list (3 in this case) and
> > not the index within the database, that is needed by DmDeleteRecord().
> >
> > Can someone explain how to get the index, needed by DmDeleteRecord()
> > when I have a subset of the database, by using a category.
> >
> >
> > Thanks
> >
> >
> >
>
>
----------------------------------------------------
Shoot-to-Win
Protect the 2nd Amendment
----------------------------------------------------