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

Paper size in reports

Status
Not open for further replies.

kettch

Programmer
Mar 5, 2001
110
US
I am having problems a report that requires a specific paper size. Basically what i have is a database that i want to use to fill out preprinted forms en mass. I worked out the report by taking a ruler to the real form and resizing the report size to fit. I also arranged all of the controls on the report to correspond to the fields on the form that i need fill out.

Everything worked out great, and when i printed a test on a regular sheet of paper, everything worked out great. The problem was that access only has specific paper sizes. The closest that it has is 3"x5", but the form needs to be 4"x6". Is there any way that i can make access use the different sized form?
 
There is a PrtDevMode property of the report that you can choose from MS Access' available sizes or you can manually set your own size. Look under help for it. I found it in my "Microsoft Access 97 Developer's Handbook" by SYBEX. It has lots of info about reports and everything else. I recommend the book to anyone...

Hope that helps... Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
could you maybe explain how i find that property?
 
Well, I haven't used it myself, but the following example straight out of the MS Access help shows an example of how to change the print orientation. You should be able to modify it to change the paper size.
Code:
The following example shows how to change the orientation of the report. This example will switch the orientation from portrait to landscape or landscape to portrait depending on the report's current orientation.

Sub SwitchOrient(strName As String)
	Const DM_PORTRAIT = 1
	Const DM_LANDSCAPE = 2
	Dim DevString As str_DEVMODE
	Dim DM As type_DEVMODE
	Dim strDevModeExtra As String
	Dim rpt As Report
	DoCmd.OpenReport strName, acDesign			' Opens report in Design view.
	Set rpt = Reports(strName)
	If Not IsNull(rpt.PrtDevMode) Then
		strDevModeExtra = rpt.PrtDevMode
		DevString.RGB = strDevModeExtra
		LSet DM = DevString
		DM.lngFields = DM.lngFields Or DM.intOrientation	' Initialize fields.

If DM.intOrientation = DM_PORTRAIT Then
			DM.intOrientation = DM_LANDSCAPE
		Else
			DM.intOrientation = DM_PORTRAIT
		End If
		LSet DevString = DM						' Update property.
		Mid(strDevModeExtra, 1, 94) = DevString.RGB
		rpt.PrtDevMode = strDevModeExtra
	End If
End Sub
Now, using this, you would change the follwoing variables, again straight out of the help file:
Code:
PaperSize	An Integer that specifies the size of the paper to print on. If you set this member to 0 or 256, the length and width of the paper are specified by the PaperLength and PaperWidth members, respectively. Otherwise, you can set the PaperSize member to a predefined value. For available values, see the PaperSize member values.

PaperLength	An Integer that specifies the paper length in units of 1/10 of a millimeter. This member overrides the paper length specified by the PaperSize member for custom paper sizes or for devices such as dot-matrix printers that can print on a variety of paper sizes.

PaperWidth	An Integer that specifies the paper width in units of 1/10 of a millimeter. This member overrides the paper width specified by the PaperSize member.
Hope that helps... Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top