The problem I have is this:
I like to print multiple invoices at the same time. To do this I have a yes/no field [tobeprinted] in [datatable1]. The query for the Invoice reports selects all records in the [datatable1] where the [tobeprinted]=False. So far, so good.
Next, I have a command button Print_Click on a form. When selected, the event procedure below is executed.
--------------------
DoCmd.RunCommand acCmdSaveRecord
DoCmd.SetWarnings False
DoCmd.OpenQuery "UpdateInvoicePartPrice", acNormal, acEdit
DoCmd.OpenReport "Invoice", acpRINT, "", ""
DoCmd.OpenQuery "updatePrintYes", acNormal, acEdit
DoCmd.RunCommand acCmdSaveRecord
End
-------------------
The Query "UpdateInvoicePartPrice" updates [invoiceprices].[partprice] from [itemlist].[unitprice] AND updates [InvoiceMain].[DateInvoiced]=Date().This is done from all records where [datatable1].[tobeprinted]=true This works great when only ONE recorded is selected to be printed. But returns the partprice to $0.00 if more that one record is selected.
Next it prints
And Finally it updates all records [tobeprinted]=No.
Why does the update not work right when more that one records [tobeprinted]=TRUE????????
This is a big problem for me.
Can anyone Help??????????
I like to print multiple invoices at the same time. To do this I have a yes/no field [tobeprinted] in [datatable1]. The query for the Invoice reports selects all records in the [datatable1] where the [tobeprinted]=False. So far, so good.
Next, I have a command button Print_Click on a form. When selected, the event procedure below is executed.
--------------------
DoCmd.RunCommand acCmdSaveRecord
DoCmd.SetWarnings False
DoCmd.OpenQuery "UpdateInvoicePartPrice", acNormal, acEdit
DoCmd.OpenReport "Invoice", acpRINT, "", ""
DoCmd.OpenQuery "updatePrintYes", acNormal, acEdit
DoCmd.RunCommand acCmdSaveRecord
End
-------------------
The Query "UpdateInvoicePartPrice" updates [invoiceprices].[partprice] from [itemlist].[unitprice] AND updates [InvoiceMain].[DateInvoiced]=Date().This is done from all records where [datatable1].[tobeprinted]=true This works great when only ONE recorded is selected to be printed. But returns the partprice to $0.00 if more that one record is selected.
Next it prints
And Finally it updates all records [tobeprinted]=No.
Why does the update not work right when more that one records [tobeprinted]=TRUE????????
This is a big problem for me.
Can anyone Help??????????