Aggregate a month sale performance

Aggregate a month sale performance

Hello,

Can someone please help me with a code how I could aggregate a performance of a salesman in C5?
I have a formA where I collect product details of sold items in normal fields (not in subform). If a product is sold I'd like to add some records of the form to formB to a subform.
I'd like to do it on monthly basis, so records belong to the same month are expected to be added to the same form, and a new form should be opened when the first sale of the new month happens.

Some of the fields of formA should be added to a subform, other to normal field in formB, simple example:

FormA                                                FormB
input.Product>>>>>>>>>>>>>>>>>row.Product
input.ProductID>>>>>>>>>>>>>>>row.ProductID
input.Salesman>>>>>>>>>>>>>>>row.salesman

input.date>>>>>>>>>>>>>>>>>>>input.date

Thank you!
George