>use employee order ssn
>Ok, here's the snippet...
>set relation to ssn into a
>set skip to employee
> replace vac_grant with a.vac_ent
>What I want this code to do is, scan thru the table in area b ssn by ssn;
>when it finds a corresponding ssn in the table in area a, replace the field
>called vac_grant in area b with the value in field vac_ent in area a.
>This set relation stuff is real confusing, and I would GREATLY appreciate any
>help with this one.
First thing I would suggest is get rid of the a,b,c,d,e stuff. After you get
deep into a program with workareas open all over the place, a,b,c,d,e,f,g or
1,2,3,4,5,6,7 becomes real meaningless real fast.
Now, I'm trying to figure out the makeup of your files. Is this a many to many
relationship? Are there many employee records for each absence and many
absences for each employee? SSN implies to me that the employee records are
unique, and that there may be many absences for each employee but not the other
Your code, however suggests that the relationship is 1 to 1. If not, then if
the employee ssn's are unique, every time you run into a new absence record for
the particular employee, you will simply overwrite what you just wrote into the
employee record from the last absence record.
If the code really is 1 to 1, then the 'set skip' is not required, and your
code then is generally correct. Add an [if !eof(childtable)] - see below.
If the relationship is 1 to many - employee to absence, then do it the other
set skip to absence
replace absence.vac_grant with employee.vac_ent in 'employee'
If I have not thoroughly confused you, then I'd very much appreciate it if you
would please explain it to me. ;)
but I'm sick of email spam.