Home > Archive > Programming with dBASE > March 2006 > How To Get Relative Row Position Of Child Rowset









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How To Get Relative Row Position Of Child Rowset
Bob Amaral

2006-03-05, 8:27 pm

I have a child database that is constrained by the parent. I know the total
number of child rows for the parent which I'm displaying on a child form. I
would like to be able to display which child row I'm currently working on,
i.e. 1 of 5, 2 of 5 according to the query order. Is there a simple way to
do this?

Thanks

Bob


Todd Kreuter

2006-03-05, 8:27 pm

Bob Amaral wrote:
>
> I have a child database that is constrained by the parent. I know the total
> number of child rows for the parent which I'm displaying on a child form. I
> would like to be able to display which child row I'm currently working on,
> i.e. 1 of 5, 2 of 5 according to the query order. Is there a simple way to
> do this?


There's no easy way to do this, especially if the child rows are in a
grid. I suppose the grid knows this information, but we don't have
access to that.

You could traverse the constrained child rowset, writing primary key to
an array, then everytime the user navigates the child, lookup the
primary key in the array which would return the element number that
corresponds to the row.

You could write the constrained child row out to a temp table which
includes sequential numbering, and a primary key. Then link the two or
lookup the primary key in the temp table to get the sequential number.

If not using a grid, maybe something simpler like bookmarking the row,
go to first, then count until you hit your bookmark.

--
Todd Kreuter [dBVIPS]
Bob Amaral

2006-03-05, 8:27 pm

Todd:

Thanks for your input. I was hoping for an easier way. I'm not using a
grid so "bookmarking" is a possibility. It seems like this kind of
feature would be "nice" for an end-user whenever they are navigating through
all the child rowsets and a child grid isn't available. Let's them know how
much they completed and how much they have to go.

Bob
"Todd Kreuter" <tkreuter@dbvips.usa> wrote in message
news:44072E1C.982D46D4@dbvips.usa...
> Bob Amaral wrote:
>
> There's no easy way to do this, especially if the child rows are in a
> grid. I suppose the grid knows this information, but we don't have
> access to that.
>
> You could traverse the constrained child rowset, writing primary key to
> an array, then everytime the user navigates the child, lookup the
> primary key in the array which would return the element number that
> corresponds to the row.
>
> You could write the constrained child row out to a temp table which
> includes sequential numbering, and a primary key. Then link the two or
> lookup the primary key in the temp table to get the sequential number.
>
> If not using a grid, maybe something simpler like bookmarking the row,
> go to first, then count until you hit your bookmark.
>
> --
> Todd Kreuter [dBVIPS]



Todd Kreuter

2006-03-05, 8:27 pm

Bob Amaral wrote:
>
> Thanks for your input. I was hoping for an easier way. I'm not using a
> grid so "bookmarking" is a possibility. It seems like this kind of
> feature would be "nice" for an end-user whenever they are navigating through
> all the child rowsets and a child grid isn't available. Let's them know how
> much they completed and how much they have to go.


If not using a grid, would probably not be much trouble to track it. You
could override the rowsets next(), first(), and last() to keep track of
where the user is. All your navigation controls (toolbars, menu items,
and buttons) that call those methods would first call your overriden
code.

--
Todd Kreuter [dBVIPS]
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com