Jump to content

How to move values from one table to another?


Andrew5

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

Recommended Posts

Greetings. I have two unrelated tables in one DB. Database table "Main" has a portal with financial entries for clients: date, amount, description, etc. The second database is "Checkbook." Sometimes we need to draft a check with the same information that is keyed into that portal in "Main." 

 

Right now, we just re-key in that same information into the Checkbook table. 

 

Can someone point me in the right direction as to how to move values from one table to the other?

 

I could write a script that would use "copy and paste" 4 times over, but I'm sure there is a more sophisticated way to do that. Thank you.

Link to comment
Share on other sites

Method 1:

Set 4 variables with the data you need from the 4 source fields; hop over to the Checkbook table, create a new record and set the 4 target fields to the corresponding variables.

 

Method 2:

Set 1 variable to the source record's unique ID. In the Checkbook table, create a new record and set a foreign key ID field to the source ID. Create a relationship between the two tables matching on the two ID fields and define the 4 target fields to lookup the data from the related record.

 

 

Copy and paste is not an option in this case, since [1] it depends on the fields being present on the layout and [2] it will destroy the user's clipboard for no good reason.

Link to comment
Share on other sites

This topic is 3781 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.