Jump to content

Copying from multiple fields and pasting to a new record in a new table


This topic is 4827 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Hi, I really need your help.

I am very new to filemaker and no programming experience. I just want to make a history page i.e. I want to copy the current value from 2 fields in a record and save it somewhere (into a new related table) with a click of a button, before changing/updating their value.

it's like, if i click that button, it will copy from Table1(field1 and field2) and create new record at Table2, paste to field1b and field2b.

I am using filemaker 11 by the way..

I hope you all understand what I mean. I know this should be easy for you guys.. :)

Thanks

Link to comment
Share on other sites

Hi, I really need your help.

I am very new to filemaker and no programming experience. I just want to make a history page i.e. I want to copy the current value from 2 fields in a record and save it somewhere (into a new related table) with a click of a button, before changing/updating their value.

it's like, if i click that button, it will copy from Table1(field1 and field2) and create new record at Table2, paste to field1b and field2b.

I am using filemaker 11 by the way..

I hope you all understand what I mean. I know this should be easy for you guys.. :)

Thanks

There are lots of ways of doing this. This is one way.

1. Make sure that table #1 has a prime key ie a unique identifier (PrimeKey). Have table #2 have a matching key (Table1Match). Relate back to table#1 from table #2 using these keys.

2. Have HistoricField1 and Historicfield2 in the Table 2. In the field definitions, have them autoenter a lookup value of the related values in table #1.

3. script:

Go to layout table 1

Copy PrimeKey

Go to layout Table 2

Create New record

Paste PrimeKey into Table1Match

Commit record

Go back to original layout

The autoenter by lookup should populate these fields in table #2

4. To display history from table #1, have a relationship from table #1 to table #2, PrimeKey to Table1Match, and show historic values in a portal.

Variants:

1. Pass the value of the Prime key using a variable

2. Have a prefs table that is cross product related to all other tables and use fields in that table to pass values using set field commands.

3. Use either of the above to capture the values of field1 and field 2 directly and don't use the lookup.

HTH

Dave

Link to comment
Share on other sites

I want to copy the current value from 2 fields in a record and save it somewhere (into a new related table) with a click of a button, before changing/updating their value.

I believe the best way to keep data is to keep it where it is, instead of moving it, erasing the original, etc. If you have data that changes from time to time and you need to track those changes, keep the changing data in a related table, with a one-to-many relationship to the "unchanging" data table. Then it's just a matter of entering the newest data into a new record in the related table.

Link to comment
Share on other sites

  • Newbies

David,

Wow.. it works... thank you very much, I follow your instruction exactly, although I didn't really understand what happen but it works... cool.. I have been trying to do this for a few days... and now it work... Thanks again.

Comment,

Thanks for your comments, can you give example? I don't really understand what you mean.. :)

Link to comment
Share on other sites

It would be better if you explained what this is really about (instead of the cryptic Table1, Table2, etc.). Here's an example anyway:

Products

• ProductID

• Name

• Description

Prices

• PriceID

• ProductID

• Date

• Price

Prices are updated by creating new records in the Prices table. The current price of a product is always located in the latest related record in Prices. No data is ever moved.

Link to comment
Share on other sites

  • Newbies

It would be better if you explained what this is really about (instead of the cryptic Table1, Table2, etc.). Here's an example anyway:

Products

• ProductID

• Name

• Description

Prices

• PriceID

• ProductID

• Date

• Price

Prices are updated by creating new records in the Prices table. The current price of a product is always located in the latest related record in Prices. No data is ever moved.

I think I understand what you mean.. I will try this.. Thanks...

Link to comment
Share on other sites

This topic is 4827 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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