AnsweredAssumed Answered

Script to add records to a related table ..?

Question asked by DamianWhite on Aug 18, 2015
Latest reply on Aug 18, 2015 by philmodjunk

Title

Script to add records to a related table ..?

Post

All,
 
I have two tables, SampleInfo and ExperimentalInfo, linked by the common Field SampleID.
 
When a users adds a new record into the SampleInfo table, I'd like my database to automatically add a new record in the related ExperimentalInfo table.  Ideally, I'd use a button on the former table, which when clicked runs a script that:
 
a) counts the number of records in the SampleInfo table
b) counts the number of records in the ExperimentalInfo table
c) if there are more records in SampleInfo, add a record to the ExperimentalInfo table
d) repeats from step 1 until both tables have an equal number of records
 
I've tried running a few scripts with the above in mind, but I'm a little new to all this and various commands I'm familiar with can't make this happen.
 

Might anyone be able to point me in the right direction?

Outcomes