Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Transfering records from one table to another?

Featured Replies

I have a database with mulitple tables. With one button I want to transfer a record from one table to another. Is there a way to do this other than copy and pasting into every field?

Heathbo

  • Author

I already have identical fields in both tables and layouts. Essentially I need to get record A in table 1 into table 2. Since the fields are identical in both tables it shouldn't be any problem, right? I guess if no one knows of a way to do this I could always use a script to copy from the fields in table 1 and paste to the fields in table 2. I just thought there might be an easier way.

Import.

  • Author

I can do that if I want to import the whole database. What if I wanted to just import one record? For example: In table 1 there is a button on the record you are looking at. When you push that button only the record you are looking at is imported into table 2. Is there a way to narrow down what records are imported with the import command?

Maybe what you could do is create a unique identifier (lets call it ID). In the first table

Create a script which copies the current ID; enters find mode, searches for current id then exports to a pre-specified filename, then moves to the appropriate table and imports that same record. As you've saved it as a pre-defined filename it should be no problem. You will have to do 1 of 2 things.

either export the file temporarily to the user's c: or use a plugin to export the file to say a name which equals the field i.e record 12940 gets exported as 12940.tab etc

Many years ago I faced the same problem and solved it exactly the same way.

1) Segregate out the record you are interested in by copying a unique id and Finding that id.

2) Export the new found set (of your one record.)

3) Import into the other table.

Works great

Am I missing something here? Has V7 changed the way import works?

Import only imports the found set so to import a particular record, you just find it in the 'remote' file and then import.

Perform Script [external- other file, "FindIt"]

Import [Restore, Add Records]

  • Author

Thanks all. I got it working. What I did is I added an ID number to each record. Then did the find. Filemaker 7 now allows you to import records into another table without having to export the record to a seperate file. So this worked out perfectly.

Thanks again

To isolate one record from a found set I always use:

show all records

omit record

show omitted

I just think it's a bit cleaner than the find method.

However, it's not mulit-user safe. Better to use a self-relation and go to the related record.

two things:

1) as a matter of practice you should have a unique id field in every table you create

2) i think it's cleaner to do a set-field than a copy-paste. set a global number field with the unique id, enter find mode, set the unique id field with the global number value, and perform the find. this way, if the user has something in the clipboard it isn't lost, and your programming is transparent to the user.

btw, brucer's method above is another good way to do this.

Why isn't it multi user safe ?

It has never been safe to do this - though the risk is probably small. If a new record is created with the right timing by another user while your script is running, you will end up with the new record in your "single record" found set. If you go to related record by record ID, that is the only record you will get, period. This point comes up regularly in other lists.

Filemaker 7 now allows you to import records into another table without having to export the record to a seperate file.

For future reference, would someone mind filling me in on how one would perform this task? Thanks! smile.gif

  • 3 weeks later...
  • Author

You use the import records/ file fuction. Then select the record your using. Then you just specify wich table data is going into which table.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.