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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cyclic Relation

Status
Not open for further replies.

jhed

Programmer
Apr 21, 2014
33
PH
I have two tables named Employee and service. My parent table is the employee which is the id field set to relation to the id field of the service table. I want to print out a report with the two tables data.. Example if I locate the id of employee which is 1 in the employee table then it should display all the services under employee id 1..I already display the information but the problems is in my report. Whenever I output the report I have this error “Cyclic Relation” which in my opinion the problem is in my setting the relation of my two tables in the data environment. It is the same relationship I used in my form with my report, my parent is the employee and child is the service table.. Please help me I don’t know what to do next. I also tried to interchange the parent table, and noticed that there’s no error encountered but the data from the service was not display in my report…so it means that was not the solution to interchanged the parent and the child table.. This is the only time I encountered this error which I know there’s nothing problem in my setting my table relation.

Thank you in advance..
 
>the design of the report or the relationship of the tables?
Another thing about the question. I am asking myself why you ask this. I suggested several times you remove anything from the report data environment and set the report datasession property to default datasession. So the relationship of the tables is defined in the form and if I ask about the design of the report, that is the layout of the report controls and the bands at design time, not the report output.

I get the impression you neither did what was suggested not understood. But instead of asking questions to get an understanding you only state it doesn't work.

There is no single best suggestion I or we can make, because there always will be several things involved which all must be setup correctly to work together. To redo this all from scratch is not a forum question but already a job, even if it's only a small one for us. But this is not something which you can expect from forum members to do for you. On top of this you are close to the solution and all you need has already been said. So if you want to redo this from scratch, then simply reread what has already been said. There is nothing more to say that would brighten things more up.

Bye, Olaf.

 
Jhed:

You have all the necessary codes, explanations and suggestions.

In my opinion, you may try to workout the examples as mentioned in the thread above. Then, once you are comfortable, go to create the report. This will help you solve your relation error and more.

 
hello sir. sorry for the late response.
i tried everything that was suggested in the thread but no luck. So i decided to add the fields from service table to employee table and in the report design, all the fields are in my employee table. i already printout the format i want but there's lot of magic i did in able to get this.
i used the for command in my report form to select exactly the data i want.
thank you for the suggestions on this thread i really appreciated..
 
Well, it's most important you comprehend your solutions and don't take something working "mysteriously" to you, so having a solution is fine.

You shouldn't compromise the schema of your data just to be able to make a report, though. To put together data into one table is possible using SQL, something like
Code:
SELECT * FROM employee LEFT JOIN service ON employee.id = service.id WHERE employee.id = 1 INTO CURSOR curReport
would put together data from employee and service and you can report on that.

Tamar was suggesting that in her post from 31 Jul 14 16:39, but you never reacted to that, as you also didn't reacted to some other posts and questions. That makes it hard to go into detail of what you didn't understood right. Just trying out things, but not showing what you tried we aren't able to correct you. It does not help at all to state the solutions don't work.

Feel free to make further questions, though. You'll learn in time and some day you may understand what's been suggested to you here.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top