Good afternoon everybody.
I'm here to exchange an idea with the fellows about child records. Let's suppose that I have a table Employees and it's related with another table named Hours.
Employees have a 1:many relationship with Hours where its recorded worked hours that this employee make in a month. When I open my form, I show the data of the employee and a browse with the hours.
If I'm working in ChangeRecord no problems, because the parent already exists and insert the childs is easy. My problem is when I insert new records where the parent not already exists.
At this point I worked 3 solutions:
1) Create a temporary .tps file that contains the child records and then when I accept the parent record i push all that info into DB.
2) Create a temporary table in DB that makes the same process but uses a Stored Procedure.
3) Use 2 different forms: one for InsertRecord (that uses .tps) and one for Change/ViewRecord that works directly at DB.
I don't know but I think all this 3 solutions is kind wrong and must have an easy way to do it. What the fellows think about it?
I appreciate all input.
Best Regards.
I'm here to exchange an idea with the fellows about child records. Let's suppose that I have a table Employees and it's related with another table named Hours.
Employees have a 1:many relationship with Hours where its recorded worked hours that this employee make in a month. When I open my form, I show the data of the employee and a browse with the hours.
If I'm working in ChangeRecord no problems, because the parent already exists and insert the childs is easy. My problem is when I insert new records where the parent not already exists.
At this point I worked 3 solutions:
1) Create a temporary .tps file that contains the child records and then when I accept the parent record i push all that info into DB.
2) Create a temporary table in DB that makes the same process but uses a Stored Procedure.
3) Use 2 different forms: one for InsertRecord (that uses .tps) and one for Change/ViewRecord that works directly at DB.
I don't know but I think all this 3 solutions is kind wrong and must have an easy way to do it. What the fellows think about it?
I appreciate all input.
Best Regards.