I have this Form Called "Invoices" that I will input a "InvoiceID" number from a drop down combo and enter. This will populate the form. I will then click a print button that will trigger this code. What it does is it will update the Duedate field in the Invoices table if the field is blank with (Current date + 30) before opening the "Invoices" report in printview to print that specific report. What Im having problem with is the code goes through the whole "Invoices" table and updates any DueDate field that is blank which it should not be doing. It should just update that specific row with that InvoiceID that you input in the beginning which is the primary key. The code I have now is this and everything works except it updates all Duedate fields that are blank.

Private Sub PrintInvoice_Click()
DoCmd.OpenQuery "SubtotalUpdate"
DoCmd.OpenQuery "InvoiceTotalAppend"
DoCmd.RunSQL "update Invoices set DueDate=date()+30 where duedate is null"
DoCmd.OpenReport "Invoices", acViewPreview, , "[Invoices.InvoiceID] = [Forms]![Invoices]![InvoiceID]", acWindowNormal


Please help thanks