Seems to me that this should work but doesn't:
Dim stDocName As String
stDocName = "rptInvoice"
DoCmd.OpenReport stDocName, acPreview, , [InvoiceID] = [Forms]![frmPaymentInvoice]![InvoiceID]
It retrieves all records, instead of the invoiceID on the form.
InvoiceID is also a field in the query that the report is based on and is displayed on the report.
Any help appreciated. Thanks.
Dim stDocName As String
stDocName = "rptInvoice"
DoCmd.OpenReport stDocName, acPreview, , [InvoiceID] = [Forms]![frmPaymentInvoice]![InvoiceID]
It retrieves all records, instead of the invoiceID on the form.
InvoiceID is also a field in the query that the report is based on and is displayed on the report.
Any help appreciated. Thanks.