Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set relation not working
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00776110
Message ID:
00776343
Views:
15
This message has been marked as the solution to the initial question of the thread.
Cris,

Your snippet looked right, So I wrote this for testing. I only set the relations differently.
Take notice as you scroll through the windows. I hope your running at least 800x600.

Tracy
* Create the Cursors 
=CreateCursors()
* Leave Cursor on last record, and browse it
Select TableC
Browse NoWait
Size Window "TableC" to 10, 50 
Move Window "TableC" by 20, 0
* Leave Cursor on last record, and browse it
Select TableB
Browse NoWait
Size Window "TableB" to 10, 50
Move Window "TableB" by 10, 0
* Set Cursor to first record, and browse it
Select TableA
Locate
Browse NoWait
Size Window "TableA" to 10, 50
* When we activate the window the other two will jump to record
Wait window "Note records in TableB and TableC before and after keypress"
Activate Window "TableA"

Procedure CreateCursors

Create Cursor TableA (pk i)
Create Cursor TableB (pk i, cfrom c(20))
Create Cursor TableC (pk i, cfrom c(20))

For n = 1 to 30
   Insert into TableA values (n)
   If Mod(n,2) = 0
      Insert into TableB values (n, "Table B")
   EndIf
   If Mod(n,3) = 0
      Insert into TableC VAlues (n, "Table C-Rec 1")
      If Mod(n,6) = 0
         Insert into TableC Values (n, "Table C-Rec 2")
      EndIf
   EndIf
EndFor

* Index TableC
Select TableC
Index On pk tag pk
* Index TableB
Select TableB
Index on pk tag pk
Select TableA
* Set one to one relation in TableB
Set Relation To pk into TableB
* Set one to many relation in TableC
Set Relation To pk into TableC Additive
Set Skip to TableC

EndProc
Tracy
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform