i had a form with a button and a subform.
i need that pressing on the button a new record in the subform will be added.
if possible in the data field of subform i'd like to save the data of that event and in another field copy the value of a field of the main form.
if i press again the button it will create a new record with data and copied field.
If you mean that you have a main form which contains the master record, the parent record, and your subform contains a child record then no it’s not possible.
It’s not possible because you can’t have a child without a parent.
I have noticed this scenario seems to be a reoccurring problem and I have been giving it some thought.
From my own experience a situation where you might want to do this would be when you are creating a quote for an unknown customer, typical scenario, someone rings you up for a price, you ask for their name, they won’t give it to you! They say they just want a price, now the system you have set up requires the parent record to be filled, in other words it is expecting a customer name.
You find that you cannot add a child record without this parent record, but you don’t know the identity of the customer, so what do you do?
One solution is to have a “special customer” in your system usually called “cash customer” or if you wanted you could call it “quotation” now once you have completed the quotation and the customer agrees to the price and wants to arrange delivery, then you just go back to the main record and change it from a “cash customer” to the actual customer who has placed the order.