Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting a relation in the DE of a form
Message
From
03/10/2002 10:05:04
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
02/10/2002 08:36:20
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00706796
Message ID:
00707302
Views:
24
>I have 2 tables in my forms DE. I need to make a parent-child relation. With Table1 as the parent and table2 as the child.
>
>table1.Field1 & table1.Field2 together make up my primary key for that table.
>
>str(field1)+'.'+str(field2) is my primary key.
>
>
>I have another table that has that key value stored in a field .
>table2.field1=(str(table1.field1))+'.'+(str(table1.field1))
>
>I need to create a relation. The only relation it will allow me to create in the DE is by making table2 the parent. This will not work for me, I need table1 to be the parent table. It wont let me create that relation. Because there is no field, just an index in table1. How can I create a relation, making table1 the parent.

Steve,
Sorry for the empty message sent yesterday. It was unintentional, started to reply and then I had to leave in a hurry even didn't notice I pressed 'send'.
To create the relation you want you could either click 'relation line' and edit it or do it in code. If you would do that in code click the line and delete it from your dataenvironment.

select table2
set order to tag < TheTagThatStartsWithField1 >
select table1
set relation to str(field1)+'.'+str(field2) into table2

PS: I'm not sure you need '.' part but if it's already in your tag expression yes.
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