Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Skip record in child table
Message
From
10/11/2003 06:23:19
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
10/11/2003 05:53:57
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00848202
Message ID:
00848210
Views:
17
>I have Form with Parent and Child table linked with Relation.
>When I do SKIP 1 for child table it moves to next record regardless of a relation with a parent table.
>I want to do SKIP in Child table only with records that are related to Parent table.
>How?

Boban,
When there is a relation there is an active order in child and you skip based on that order. If you hit the last record within that relation and skip 1 in child you get next record in that order and it might be the record related with next record in parent. However you can limit the got top,bottom,skip to work only on parent related childs. To do that as you move in parent set key to parentkey in child. ie:
Clear All
use customer
use orders in 0 order tag cust_id
set relation to cust_id into orders
locate for cust_id='FRANK' && Move to FRANK in parent
set key to customer.cust_id in orders
go bottom in orders
? orders.cust_id, orders.order_id
go top in orders
? 'Listing for '+customer.cust_id
Do while !Eof('orders')
  ? orders.cust_id, orders.order_id
  Skip 1 in orders
enddo
Set Key To '' in orders
locate for cust_id='BONAP'
set key to customer.cust_id in orders
? 'Listing for '+customer.cust_id
Do while !Eof('orders')
  ? orders.cust_id, orders.order_id
  Skip 1 in orders
enddo
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform