Hello! I have a database that contains sales done to the clients and I am working on invoice printing function. The idea is that on client details page I have 'Print Invoice' button which runs query that requests all data from this clients sales whos details are open where checkbox 'Invoiced' = False and puts all data returned to report form which will be saved as PDF. When file is successfully saved 'Invoiced' will be set to 'True". Before that I run append query that should generate new field onto 'invoices' table and it also shows this invoiceid on the report. The problem I have is that when I add new sales or for testing purpose removed change 'Invoiced' to False under 'sales' table and run 'Print Invoice' again then this generated id via append will be overwritten and every time I press it I get same invoiceid for every report.
What I like to know how I can generated invoiceid before report is made and pin this invoiceid to the sales that were selected in case to keep track in future that what sales belong to that invoice or something.
Hope you understood and can help me, will include code if needed.
Regards
What I like to know how I can generated invoiceid before report is made and pin this invoiceid to the sales that were selected in case to keep track in future that what sales belong to that invoice or something.
Hope you understood and can help me, will include code if needed.
Regards