AnsweredAssumed Answered

Copy values of field n times based on relationship

Question asked by answer42 on Aug 20, 2016
Latest reply on Aug 20, 2016 by philmodjunk


So, I have table A with a serial number as key field and other metadata on participants of an experiment (sex, age, etc). This table has a one-to-many relationship (based on key field) with a second table B with answers on a diet questionnaire for each participant. I then have a portal on the layout of table A that lets me introduce the answers to each question (for each participant).This works fine.

However, one of the fields on table B is food item and it will always take the same values (meat, fish, eggs etc). The portions and frequency are the ones that change from individual to individual. I wanted to know if there's any way I can "freeze" this first column on my portal, so instead of always repeating the name of the food item, I can just fill in portion and frequency.

I thought of writing a script for a button (on layout of table A) that would copy the values of that field (column) of table B every time I changed the record on table A, but I don't know how to go about it.

Not sure that was clear but I'm quite new to the program and couldn't find similar questions here, so I was hoping someone could help.