I created a form which loads values into a report.
When the report opens in 'Report' mode - acViewReport - I can see the values I set for the text boxes in the report.
However when I press 'Print Preview', the values in the report disappear and all I can see are the 'label text' for the text boxes I setup in the Report
-
The code in the form that activate the report is
Code:
Private Sub Command0_Click()
Dim reportname As New Report
DoCmd.OpenReport "dfsdf", acViewReport, , , acWindowNormal
Set reportname = Reports![dfsdf]
reportname!Text0.SetFocus
reportname!Text0.Text = "sdfsd"
End Sub
For this example, the only control on the report is a single text box called "Text0". and the only control on the form is a command button called "Command0"
I'm using MS Access 2007 - MS Office 2007.
The report is not linked to any tables or queries - I've code in the form which access the tables, does the calculations, and loads the final values into various text boxes which I've setup in the report. All works fine - the calculated values get displayed in the various text boxes in the report - but when I click Print Preview, the values disappear and only the labels stay on !