The Digital Man Posted April 6, 2006 Share Posted April 6, 2006 What I want to do is copy a set of related records from one table (HISTORY) into a second table (CLOSED_HISTORY) Now I know some will say to just mark the records closed but I am going to be stubborn and refuse to do this. I am thinking about exporting the subset of records into an excel file and then re-importing them into the CLOSED_HISTORY table from the excel file. But that seems like a lot of unecessary disk I.O. It just seems like there ought to be a better way of doing it. Can I go to the CLOSED_HISTORY table and import the found records from the HISTORY table? How would I code that? It seems like I could do that in FileMaker 6 when we had seperate files for each table so why couldn't I do the same now? If I can could someone clue me in to how I would code it? I've also considered looping through the subset of HISTORY records and setting several script steps to copy the contents of EACH FIELD from the HISTORY record into the CLOSED_HISTORY record. This seems like a lot of set field statements and there should be an easier way. In my other life writing in FoxPro back in the 1980's before MicroSoft bought them you could COPY a RECORD into a specially defined VARIABLE which copied every individual field into memory. You than executed a copy from that variable into your new record and it copied all the fields into the new record. It was pretty cool. I don't suppose FileMaker Pro has a similar command? One statement copied all the fields in the record to or from the special variable. Alright, as always thank you in advance for your time. Randy Quote Link to comment Share on other sites More sharing options...
Ted S Posted April 6, 2006 Share Posted April 6, 2006 Randy, I did something like this just last week. And for some reason it was simple but not intuitive for me. In a nutshell; the key is that you don't really have to export anything. What you do is get your source data ready by doing a FIND for the proper records and then switch over to your destination table and then IMPORT the source file. The same .fp7 file that your source records are in. Match up the fields and wah-lah. Please write back if I'm not being clear. Quote Link to comment Share on other sites More sharing options...
Ender Posted April 6, 2006 Share Posted April 6, 2006 Keep in mind, when importing from the same file as the destination file, if there's more than one window open of that file, it will import all records from the source table instead of the last found set from that table. Quote Link to comment Share on other sites More sharing options...
The Digital Man Posted April 6, 2006 Author Share Posted April 6, 2006 Thanks Ted & Ender, I agree with you Ted. Its not intuitive to select the file you currently have open and are working in but it does work. Thanks for the sidenote Ender. In my current solution I never have more than just the one main window open. But I will keep this in mind if I ever develop anything with more than one window open. Anyway the good news is that I now have a working script that is indeed doing what I wanted. Thanks again! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.