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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable gray background when printing forms?

Status
Not open for further replies.

hsitz

Programmer
Dec 14, 2000
396
0
0
US
I'm wondering if there's a simple setting that will skip printing the shading of the detail background of a form when printing. As it is, the form prints with a gray background. I could change the shading of the detail background in code in VBA, but I'm wondering if there's an even easier way. I don't want to change background of form to white because that doesn't offer enough contrast with white textboxes on the form.

Thanks,

Herb Sitz
 
I've found that it's better to print a report then to try to print the form. The form never seems to look as good on paper. Therefore, I create a report that contains all of the information the form contains (formatted so it looks good on paper). Then I give the user the option of printing just the current record shown, just the records that are shown (i.e. filtered), or all of the records. In addition, the report will be ordered the same way as the report. For the report to display all of the records or all of the filtered records, add the following code in the OnOpen event of the report. Note that if the form did not launch the report (i.e. report launched someother way), the report will print the data that is based on its Recordsource (no filtering will be done).

If (CurrentProject.AllForms("MyForm").IsLoaded) Then
Me.Filter = Forms!MyForm.Filter
Me.OrderBy = Forms!MyForm.OrderBy
Me.FilterOn = Forms!MyForm.FilterOn
Me.OrderByOn = forms!MyForm.OrderByOn
End if

In addition, I create a custom menu bar and toolbar that contain buttons that look like the print and preview button. But when activated, launches my report. This is a generic routine that can be used by all of my forms. It assumes 1 thing, that the name of the form and the name of the report are the same with the exception of the prefix. For example, the report assigned to frmMain is rptMain.
 
Thanks, but I'm looking for a very barebones solution. I very rarely print forms directly, either, but this is a very small job, the form looks great printed, and I don't want to have problems in the future with revising a report object if changes are made to the form (which has same format as the user wants printed).

Modifying the background color for the detail item in the form just takes a single line of code, but I was wondering if there was an even simpler way that would make the background white even when the user chooses 'Print' off the built-in menus. There doesn't appear to be, so I'll just try adding a 'Print' command button that changes the background color, prints, then changes color back again.

Thanks for the suggestion, though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top