Hello,
I'm trying to export a report based on a query which has a parameter.
this parameter has to come from the recordset.
now if i run the procedure it asks me for the parameter.
How do i get it to take the parameter from the recordset?
it should take the column 'Company#' from the recordset
here is what i have now:
Public Function mOutstandingInvoices2()
On Error GoTo mOutstandingInvoices2_Err
Dim rst As Recordset
DoCmd.SetWarnings False
'On Error GoTo BREAKOUT
Set rst = CurrentDb.OpenRecordset("tRemindersAllCompanies")
Do Until rst.EOF
DoCmd.OutputTo acOutputReport, "qRemindersB2SelectDataFirst", "PDFFormat(*.pdf)", "C:\Temp\Outstanding invoices " & rst![Company Name] & ".pdf", True, "", , acExportQualityPrint
DoCmd.SetWarnings False
rst.MoveNext
Loop
mOutstandingInvoices2_Exit:
Exit Function
mOutstandingInvoices2_Err:
MsgBox Error$
Resume mOutstandingInvoices2_Exit
End Function
hopfully this makes sense...
thanks,
Lucas
I'm trying to export a report based on a query which has a parameter.
this parameter has to come from the recordset.
now if i run the procedure it asks me for the parameter.
How do i get it to take the parameter from the recordset?
it should take the column 'Company#' from the recordset
here is what i have now:
Public Function mOutstandingInvoices2()
On Error GoTo mOutstandingInvoices2_Err
Dim rst As Recordset
DoCmd.SetWarnings False
'On Error GoTo BREAKOUT
Set rst = CurrentDb.OpenRecordset("tRemindersAllCompanies")
Do Until rst.EOF
DoCmd.OutputTo acOutputReport, "qRemindersB2SelectDataFirst", "PDFFormat(*.pdf)", "C:\Temp\Outstanding invoices " & rst![Company Name] & ".pdf", True, "", , acExportQualityPrint
DoCmd.SetWarnings False
rst.MoveNext
Loop
mOutstandingInvoices2_Exit:
Exit Function
mOutstandingInvoices2_Err:
MsgBox Error$
Resume mOutstandingInvoices2_Exit
End Function
hopfully this makes sense...
thanks,
Lucas