I have a report which can be run via a button on a form. The button runs some VBA code:
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "First save this record and then select a record to print"
End If
If Me.NewRecord = False Then
DoCmd.OpenReport "MultiInvoice", acViewPreview, , "InvoiceNo = '" & Me.InvoiceNo & "'", , "NoGroup"
End If
Once when I clicked on the button and then clicked "print" on the Access menu, strangely what was printed was the form and not the report.
Now when I try to repeat this, the Access "print" button is always disabled.
Any ideas as to why these things are happening?
... Update: I restarted Access and tried this again and it worked OK, so it must have been some glitch in Access.