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

Set page margins using Inputbox

Status
Not open for further replies.

pdtit

Technical User
Nov 4, 2001
206
BE
Hello,

I was wondering if it possible to have the user specify the upper margin using an Inputbox, and set it using VBA.

I have a customer with preprinted paper of all different sizes, and he wants to select where the first line of the report should start printing. I know this is easy to do using the GUI interface, but I wonder if it is possible using VBA ?

Regards,

Peter
 
Create a new "page" header by:
-Add a primary sorting and grouping level
-set its Field/Expression to =1
-display its Group Header section
-set the Repeat Section property of the =1 group header to Yes
-Add a text box to the group header named txtGrow
-set the properties of txtGrow so that it doesn't show
-add code to your report
Code:
Option Compare Database
Dim intHeight As Integer

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
    Me.txtGrow.Height = intHeight
End Sub

Private Sub Report_Open(Cancel As Integer)
    intHeight = 1440 * InputBox("Enter the height in inches", "Enter Height", ".5")
End Sub

The user should be prompted for the height and the section should expand.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top