Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Relationship Problems
Message
From
22/09/1999 10:12:13
Jolene Dicks
Human Resources Development Canada
St. John's, Newfoundland, Canada
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Relationship Problems
Miscellaneous
Thread ID:
00267561
Message ID:
00267561
Views:
58
I am trying to set up a relationship between two tables in order to do one replace statement by a particular field. The same code never seems to work twice, not the same way anyway...

Below is the code that I am testing...

Use Gidetail && This is my child table
Set order to sessionkey && Common field

Select sessionkey from gisum;
where Upld_stat = 1 into ;
table o:\Tmp && Tmp will be my parent table

Set Relation to Tmp.sessionkey into Gidetail

Replace all Gidetail.dnld_stat with 1 for;
Gidetail.sessionkey = Tmp.Sessionkey


What I would like to accomplish is to establish a list of records (from the Gisum table), from which I can replace the dnld_stat with 1 for in the Gidetail table.

The relationship is fine when I check it. I browse both tables and as I click on a sessionkey in the Tmp (parent) table, only those sessionkey records display in the gidetail (child) table. However, the replace statement doesn't work. I have played around with the = condition (just reversing - Tmp.Sessionkey = Gidetail.sessionkey). It will only mark the first of multiple sessionkey records. Either that or sometimes, it will mark all the sessionkey records for the current sessionkey in the Tmp (parent) table.

I have always had trouble with this code. Other times, I have done it competely backwards and it works. For instance, in reference to the code that I have above, I have indexed the tmp table once it has been created and basically made tmp the child and gidetail the parent. It worked!!! In other instances.... But not this time.

If anyone has any suggestions, please let me know.

Thanks!!!!


Jolene Dicks
Next
Reply
Map
View

Click here to load this message in the networking platform