Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dataenvironment Relations 2

Status
Not open for further replies.

itflash

Programmer
Jul 18, 2001
535
GB
Hi

I have a question about creating relationships in the form.

I have a table - contract
contract has two fields user1 and user2.

Both these fields have a relationship to the user table.
However, in my dataenvironment, I cannot create this relationship. I can create them at the database level.

Is this true, it appears a field can only have one relation at one time?

Any ideas
Thanks

 
You should be able to open the user table AGAIN as an alternate ALIAS, and set the second relationship to it. (While I don't use the data environment, I do this in code all the time.)

Rick
 
Hi,

As I understand it you are trying to relate two different values from one Contract record to different records in the User table. Although you can logically set this up in the DE I what I think will happen is that the record pointer in the User table will settle on the record which matches the second relation.

You could add the User table again under an alias (or leave it as the default User1) and set a second relation to that.
 

thanks guys, think I'll stay clear of this relationship, would get bizare results as the pointer gets messed up, like sarklow says.

by the way rick, what do you use instead of the data environment?

I ask because I still trying to find out the best way of writing my apps. See my other question as well.


 
Because I often directly create form objects with classes instead of DOing Forms, and these don't have a dataenvironment, I handle opening all the files in code - usually in the class/form LOAD(). You can also set the indexes, and relationships you require here. (And for those that wish to point out there is a now a DataEnvironment BaseClass, yes I know, and in some cases I will use these with my form classes.)

Rick
 

Thanks for the reply.

Bit too technical for me at this stage, I think I'll stick to doing forms.

I do use classes though, but I have not tried creating forms in this way.....yet.

Thanks again.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top