Normal Topic Copy and Paste (Read 1224 times)
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Copy and Paste
Dec 18th, 2010 at 3:15pm
Print Post Print Post  
Hello!

To save typing i would like using two buttons Copy and paste a previously saved order with the same Items.
So I just need  to give a new RecNo and the date only. I've tried but I could only copier the parent form.
Does anyone have any idea how I assume the subform Items?

Thanks for your help.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Copy and Paste
Reply #1 - Dec 21st, 2010 at 8:00pm
Print Post Print Post  
I've got a similar need but I've been putting it off because I think it's going to be tedious. There are probably several ways to do it, but my best guess is that it will require an XResultsetSearch to retrieve the subform records needed, then 'loop through' the found records (see the manual for a loop example), and use createnewrecord() command to create new subform records and formfieldvalue() to populate the subform fields during the loop process.

Hope that helps. Reply back if you find an easier approach.

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



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Copy and Paste
Reply #2 - Dec 21st, 2010 at 9:46pm
Print Post Print Post  
Quick thought off the top of my head...
An export/import routine would easily copy the parent data and all subrecord data (even if you had multiple subforms). You would need to include programming to assign things like RecNo, after the import.


Edit:
One problem with this is that you would have to have just one record in the result set -- the one you want to copy.
  


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


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Copy and Paste
Reply #3 - Dec 21st, 2010 at 10:46pm
Print Post Print Post  
Great idea, Carl. Especially with the recent addition (?) of 'runexportspec()' command. Great feature!

Steve
  
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Copy and Paste
Reply #4 - Dec 22nd, 2010 at 4:18pm
Print Post Print Post  
Hello Carl-


Thanks for your recommendation however when I import an exported Parent record with 10 Subrecords, i get 10  Parent records with one Subrecord each.


Thanks.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Copy and Paste
Reply #5 - Dec 22nd, 2010 at 5:22pm
Print Post Print Post  
Hello Amor,

Check your Import Spec and make sure that the field order matches the Export spec completely. If it's off by a field or field is in a different spot, you can get what you are seeing.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Copy and Paste
Reply #6 - Dec 23rd, 2010 at 1:53pm
Print Post Print Post  
Hello Ray,
Thank you  for the corrigendum . My mistake ist corrected and my Import now is correct.
I wish you and all Members  this Forum merry Christmas and good luck and health for the new year.

-Amor
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged