This seems like an easy task but it's giving me fits...
I'm moving my office database from FM to A5 so I'm moving from a flat-file system to the relational and something that was easy has suddenly become somewhat complicated (for me anyway).
I have a SET called CASES with a 1:N relationship with REFERRALS (I can test the same kid many times). The REFERRALS has a 1:1 with test scores from a number of tests (so there are several test tables). Anyway I need to export a single students scores... I've read up on the flattenquery and such but I don't know if I need that... I have a form based on the SET with a subform for Referrals (the 1:N). I want to export based on the current record. Well I keep getting all the records (or none depending upon my current attempt) So here is the script that doesn't work (I tried using table.current(1), etc but that didn't seem to help).
BTW: I took out some of the fields to shorten the script for viewing...
a_tbl = table.current()
query.order = "recno()"
record_number = current_record_number()
query.filter = "recno() = " + record_number
query.options = "I"
export.type = 0
export.names = .t.
export.file = "F:\ALPHA 5 projects\A5 Psychoffice\Report Templates\merge_gtc.asc"
export.options = "LT"
export.field_sep = ","
export.record_sep = ""CR""LF""
export.fields = 43
export.field1 = "Case_Info-"Stu_lfirst"
export.field2 = "Case_Info-"Stu_mid"
export.field3 = "Case_Info-"Stu_llast"
export.field4 = "Case_Info-"Dob"
export.field5 = "Case_Info-"Age"
export.field6 = "Case_Info-"Sex"
export.field20 = "Referral_Info-"Begin_test"
export.field21 = "Referral_Info-"End_test"
export.field22 = "Referral_Info-"Report"
export.field23 = "Das_Data-"Patt_con"
export.field24 = "Das_Data-"Rec_design"
export.field25 = "Das_Data-"Word_def"
export.field34 = "Group_Achievement-"Itbs_math"
export.field35 = "Group_Achievement-"Itbs_language"
export.field36 = "Group_Achievement-"Core_total"
export.field37 = "Group_Achievement-"Mat_reading"
export.field38 = "Group_Achievement-"Mat_language"
a_tbl.export()
I'm moving my office database from FM to A5 so I'm moving from a flat-file system to the relational and something that was easy has suddenly become somewhat complicated (for me anyway).
I have a SET called CASES with a 1:N relationship with REFERRALS (I can test the same kid many times). The REFERRALS has a 1:1 with test scores from a number of tests (so there are several test tables). Anyway I need to export a single students scores... I've read up on the flattenquery and such but I don't know if I need that... I have a form based on the SET with a subform for Referrals (the 1:N). I want to export based on the current record. Well I keep getting all the records (or none depending upon my current attempt) So here is the script that doesn't work (I tried using table.current(1), etc but that didn't seem to help).
BTW: I took out some of the fields to shorten the script for viewing...
a_tbl = table.current()
query.order = "recno()"
record_number = current_record_number()
query.filter = "recno() = " + record_number
query.options = "I"
export.type = 0
export.names = .t.
export.file = "F:\ALPHA 5 projects\A5 Psychoffice\Report Templates\merge_gtc.asc"
export.options = "LT"
export.field_sep = ","
export.record_sep = ""CR""LF""
export.fields = 43
export.field1 = "Case_Info-"Stu_lfirst"
export.field2 = "Case_Info-"Stu_mid"
export.field3 = "Case_Info-"Stu_llast"
export.field4 = "Case_Info-"Dob"
export.field5 = "Case_Info-"Age"
export.field6 = "Case_Info-"Sex"
export.field20 = "Referral_Info-"Begin_test"
export.field21 = "Referral_Info-"End_test"
export.field22 = "Referral_Info-"Report"
export.field23 = "Das_Data-"Patt_con"
export.field24 = "Das_Data-"Rec_design"
export.field25 = "Das_Data-"Word_def"
export.field34 = "Group_Achievement-"Itbs_math"
export.field35 = "Group_Achievement-"Itbs_language"
export.field36 = "Group_Achievement-"Core_total"
export.field37 = "Group_Achievement-"Mat_reading"
export.field38 = "Group_Achievement-"Mat_language"
a_tbl.export()
Comment