On Load not working for PDF

Tieval

Still Clueless
Local time
Today, 11:12
Joined
Jun 26, 2015
Messages
475
Hi,

I have a report which prints from a print button on a form using the standard macro method, I use the On Load of the report to populate one of the fields in it from an If statement, this works perfectly.

However I have another button which outputs to PDF by running code and the On Load does not seem to work (well the field is not populated).

Code:
Private Sub Command25_Click()
On Error Resume Next
DoCmd.OutputTo acOutputReport, "Bladereport", "PDFFormat(*.pdf)", , True, , , acExportQualityPrint
On Error Resume Next
End Sub
 
Why would you have ON LOAD fill in a field, when the report gets all the data from a table/query?

What is the code doing?
 
My application is designed for browsing a central form and filtering the data displayed, occasionally people might want to print or save a PDF of the information.

I have an option group in the form with All/Pass/Fail giving 1/2/3 values.

Depending on which is selected a sub form filters Pass/Fail/All and shows only the required data, this works perfectly.

My report basically shows the data in the sub-form but in it's header has a number of fields explaining what the data is, one of these shows data for Pass/Fail/All and the on load of the form is as follows:

Code:
Private Sub Report_Load()
If Forms![Scan Data]![Frame13].Value = 1 Then [Text19] = "All"
If Forms![Scan Data]![Frame13].Value = 2 Then [Text19] = "Pass"
If Forms![Scan Data]![Frame13].Value = 3 Then [Text19] = "Fail"
End Sub
 

Users who are viewing this thread

Back
Top Bottom