humpydumpy2000
IS-IT--Management
hi all,
I would like to save an unbound report as pdf, the problem is access is bit confused what I did was to make a command button in a form and embeded the following code in an onClick event:
Dim wsSQL As String
wsSQL = "SELECT * from tblsubject;"
Set db = CurrentDb
Set rs = db.OpenRecordset(wsSQL, dbOpenDynaset, dbSeeChanges)
Reports!rpt!subject = rs.Fields("subject").Value
rs.Close
db.Close
DoCmd.OutputTo acOutputReport, "rpt", "PDFFormat(*.pdf)", "report.pdf", True, "", 0, acExportQualityPrint
access tells me its error 2451: report name rpt doesnt exist. Any ideas please?
I would like to save an unbound report as pdf, the problem is access is bit confused what I did was to make a command button in a form and embeded the following code in an onClick event:
Dim wsSQL As String
wsSQL = "SELECT * from tblsubject;"
Set db = CurrentDb
Set rs = db.OpenRecordset(wsSQL, dbOpenDynaset, dbSeeChanges)
Reports!rpt!subject = rs.Fields("subject").Value
rs.Close
db.Close
DoCmd.OutputTo acOutputReport, "rpt", "PDFFormat(*.pdf)", "report.pdf", True, "", 0, acExportQualityPrint
access tells me its error 2451: report name rpt doesnt exist. Any ideas please?