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

Fit an Access form to a single page

Status
Not open for further replies.

CarolCook

IS-IT--Management
Mar 7, 2003
158
US
Is there any way (as there is in Excel) to force an Access form to fit on a single page?

Thank you in advance
 
I don't believe Access has that cabability. The only thing I can think of is to do the ALT-PrintScreen and then paste it and size it the way you want.
 
Perhaps I am not understanding what you are trying to do here. Forms are a GUI component for data entry and data updates. If you want something that is printed, you should be using a report.

-Brian-
I'm not an actor, but I play one on TV.
 
I have a client that wants to simply fill in the information on the screen and then dump the whole thing to the printer (they like the format with the boxes, etc.) sort of as an 'audit' of what they've done. But it comes out on two pages. Begin familiar with Excel, they were looking for a 'fit to page' kind of thing . . . I did tell them that they should have a report and that they could put a checkbox on the form which would print the report.
 
That would be the best solution. Access is not Excel and Excel is not Access. They each have their strenths and weaknesses.
 
Well, then, your only solution is to design the form to meet the height and width of a standard page. As most pages utilize a 1" border on all sides, your form should be no wider than 6.5" and no longer than 9". There is no functionality within Access that I know of which mimics the "fit to page" functionality in Excel.

If I were in this situation, I would develop a printed report which mimics the format of the form and present that to the client as an alternative. I would also try to educate them on why forms are not a viable print format. I would further explain that attempting to resize the form to meet the requirements of a printed page may drastically effect the design and flow of the existing form. Of course, if this is an hourly project, they may be less than willing to commit to reformatting the form, against recommendation, when it will cost them extra $$.


-Brian-
I'm not an actor, but I play one on TV.
 
I would add that if you're going to redesign the form to fit a one-page print out, consider keeping the original form as your client likes it and make your changes to a copy of the form. Have a command button labeled "Print" that prints the redesigned form.

Also, be aware that you can open the form in design view, select all of the controls and paste them into the design view of a new Report. You would have to edit the control source to include a reference to the form (EG: txtCustId in the form is changed to Forms!MyForm!txtCustId)

This would ensure that only the current record is printed and give you the same look as the form.

A third "Give-the-customer-what-they-want" option would be to use a version of the following code on a command button labeled "Print".

The code changes the form's size (75% of original), prints the current record and resets the sizes. Yu will probably have to add to the If...Then portion to include all of the cntrols on your form that have text for changing the fontsize.

Code:
Private Sub cmdShrink_Click()
For Each ctl In Me.Controls
ctl.Left = ctl.Left * 0.75
ctl.Height = ctl.Height * 0.75
ctl.Width = ctl.Width * 0.75
ctl.Top = ctl.Top * 0.75
If ctl.ControlType = acTextBox Or ctl.ControlType = acLabel Then
ctl.FontSize = ctl.FontSize * 0.75
End If
Next ctl
Me.Width = Me.WindowWidth * 0.75
Me.Detail.Height = Me.Detail.Height * 0.75
Me.Repaint
DoCmd.PrintOut acSelection
Me.Width = Me.WindowWidth * 1.25
Me.Detail.Height = Me.Detail.Height * 1.25
For Each ctl In Me.Controls
ctl.Left = ctl.Left * 1.25
ctl.Height = ctl.Height * 1.25
ctl.Width = ctl.Width * 1.25
ctl.Top = ctl.Top * 1.25
If ctl.ControlType = acTextBox Or ctl.ControlType = acLabel Then
ctl.FontSize = ctl.FontSize * 1.25
End If
Next ctl
Me.Repaint

End Sub


HTH



John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top