Try:
Code:
Private Sub PrintInvoice_Click()
DoCmd.OpenQuery "SubtotalUpdate"
DoCmd.OpenQuery "InvoiceTotalAppend"
DoCmd.RunSQL "update Invoices set DueDate=date()+30 where duedate is null and [InvoiceID] = [Forms]![Invoices]![InvoiceID]"
DoCmd.OpenReport "Invoices", acViewPreview, , "[Invoices.InvoiceID] = [Forms]![Invoices]![InvoiceID]", acWindowNormal
Note:
If you want to add 1 month not 30 days then try this:
Code:
DoCmd.RunSQL "update Invoices set DueDate=DateAdd(""m"", 1, Date()) where duedate is null and [InvoiceID] = [Forms]![Invoices]![InvoiceID]"