Adding new Field and Saving in DB

Hi

Im trying to make a form based on one table.
But i need a new field and a value of this field i want save in another table…
How can i do it?

Probably i can use macro ( update another table ) on Validate event

But im looking for something like linking new field with other table. Is there any posibility to do it?
What if i need form with 40 fields, 20 fields from one table and 20 fields from another ? How can i make a multitable form? Is there any solution?

Re: Adding new Field and Saving in DB

onafterupdate or onafterinsert

you can do something like this:

sc_exec_sql(“UPDATE OTHER TABLE SET campo=’{campo’ … WHERE KEY = ‘{your_key}’”})

Why you need to put this on the event afterinsert or afterupdate instead of onValidateSuccess?
Because onValidate only validates the content of the field based on its type. If you update your other table in this event if occurs any error when inserting or updating your main table, your main table will be outdated but you already executed the update of the second table.