Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report header text boxes fill in acViewPreview but not in acViewNormal 1

Status
Not open for further replies.

PeDa

Technical User
Oct 10, 2002
227
NL
My report header must contain text in a number of text boxes (mAanleiding, mAuditor etc.) filled from fields in an open form linked to a table:

Code:
Private Sub Report_Load()
Me.Caption = "Toezegging" & Str(Forms!frmLint_Overzichten_Toezeggingen_Bladeren!mNummer_i)
Kop.Caption = "Toezegging" & Str(Forms!frmLint_Overzichten_Toezeggingen_Bladeren!mNummer_i)
mAanleiding = Forms!frmLint_Overzichten_Toezeggingen_Bladeren!mAanleiding
mAuditor = Forms!frmLint_Overzichten_Toezeggingen_Bladeren!mAuditor
mAntwoord = Forms!frmLint_Overzichten_Toezeggingen_Bladeren!mAntwoord
mAfsluiting = priAfsluiting
Voet.Caption = "Afdruk: " & Format(Now, "dd mmmm yyyy hh:mm")
End Sub

This works fine in print preview, but if I sent the report directly to the printer the text boxes are empty.

If I open the report with acViewPreview, and then with acViewNormal, the printed version does contain the content of the text boxes, but this is not practicable, as my form is modal, and I want to browse in it to another record and then print another report based on the then current record.

Later: I can also get acViewNormal to work by filling the text boxes from the Details_Format event instead of the Report_Load event, but that does not seen very elegant, as that will, I assume, fire for each record in the report.
 
>I would add the code to the On Format event of the section of the report containing the controls.

Yes indeed; this works fine; thank you

>Do you have any code that closes the form at any time?

No; the calling form checks for available data to report
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top