Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Relation in the dataenvironment
Message
From
28/12/2002 10:14:12
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00736265
Message ID:
00736283
Views:
13
>I am building a software for a repair shop
>
> I am using free tables
>
> I've created a table clients and a table devices
> In the table clients I have a field called "code"
> and in the table devices I have a field called "id"
>
> I created a relation between the fields code and id
> This relation was created in the dataenvironment
>
> I have a problem:
>
> When a client is deleted their devices stays still in
> the table devices
>
> I mean; if I delete client number #2 the devices with id # 2
> o the table devices will still be there.
>
> When a new client is added to the record # 2 of the table clients,
> he will get the devices of the table devices with id # 2
>
> How can I solve this problem ?

Moises,
You should set a relation from an parent field to an existing index on child. As I understand your relation is from devices to clients.

use devices
use clients order tag code in 0 && Assuming has an index on code
set relation to id into clients && Relation to code as it's active index

But instead if you do this (I think it's your problem) :
use devices
use clients in 0 && No order set
set relation to id into clients

VFP uses record numbers by default. ID#2 would always relate to clients rec#2.

If you clearly tell how a relation you want and how you would show it on form we can help further (it might be that you don't need to create any relation).
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
Next
Reply
Map
View

Click here to load this message in the networking platform