Normal Topic Unwanted duplicate record subform sorting (Read 502 times)
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Unwanted duplicate record subform sorting
Mar 11th, 2012 at 12:54pm
Print Post Print Post  
I’m using @LoadExportSpec() and RunExportSpec("", "", "", 0, 0, 0, 0, 0, 0, 0, 0)  then, @LoadImportSpec() and RunImportSpec() to create a duplicate record. The record does get duplicated, but somewhere along the way the subform data gets sorted alphabetically, is there a way I can get the subform data to come in to the duplicate in the same order as the original record? I don’t have any default sort specs set for the subform.

Thanks
  
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Unwanted duplicate record subform sorting
Reply #1 - Mar 11th, 2012 at 9:41pm
Print Post Print Post  
You probably shouldn't be relying on Sesame to maintain the order of the subform records based on the order that they were entered. You really should have a field that you can sort by. Then, you don't need to be concerned with the order that they export/import, because you will sort them anyway.

Here's an example of what I did to resolve this...

I have an invoicing application in which I have a line item subform that details the work performed. This subform has a date field, but I didn't want a date on every line. I just wanted each date to appear only once -- a single line to include the date and labor charges, then a line (or lines) below that which detail the materials. The materials lines do not have a date filled in. Each successive date and labor line is followed by the material used on each of those dates.

There was no way to be sure the materials line(s) would always fall into place below the date for which they belonged. So, I added another field that is simply titled "Sort". This field contains numbers corresponding to the position for which each record should appear in the table view subform. This way, I can simply have a default sort attached to the subform, and my line items are always displayed in the proper order. So, I get a line with a date and labor, followed by the materials lines, then another line with a date and labor, followed by more materials lines, and so on.

I don't worry about entering the numbers into the Sort field. Programming takes care of that for me.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: Unwanted duplicate record subform sorting
Reply #2 - Mar 11th, 2012 at 10:39pm
Print Post Print Post  
Got it, love it!

Thank you, Carl!
  
Back to top
IP Logged