Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2009
    Brisbane Australia

    Cool Unanswered: Coordinates on Report

    Can someone explain how the coordinates work when using VBA to draw a line or a box on a MS Access report?

  2. #2
    Join Date
    Sep 2002
    South Wales
    This link may assist:-

    ACC2000: How to Convert Twips to Pixels

    Measurements are in 'Twips' - If you have a more specific question, just reply and post any code you have at the moment...
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  3. #3
    Join Date
    Sep 2009
    Brisbane Australia

    Lines and Rectangles

    Thanks for the prompt reply. I am trying to create a template border for a report I am running from MS Access. I am trying to fill the top header with light grey. I also wish to understand how the coordinates work so I can position lines and rectangles more accurately. Here is the code. I am sure there is a more effecient way to achieve the same thing but I am learning and this seems to work.

    Private Sub Report_Page()
    Dim intReportWidth As Integer
    Dim intReportHeight As Integer
    Dim intLineTop As Integer

    intLineTop = 840 'Starting point for top of line from top of page
    intReportHeight = 9600
    intReportWidth = 14520

    '/// Draw border around page
    Me.DrawWidth = 20
    Me.Line (0, intLineTop)-(intReportWidth, intReportHeight), , B 'Table border

    '/// Draw vertical lines from LH Side
    '(how far accross the page you want to go, intline top)- (need to make same, intReportHeight)
    Me.Line (854, intLineTop)-(854, intReportHeight) 'Vertical line 1
    Me.Line (1708, intLineTop)-(1708, intReportHeight) 'Vertical Line 2
    Me.Line (2562, intLineTop)-(2562, intReportHeight) 'Vertical Line 3
    Me.Line (3416, intLineTop)-(3416, intReportHeight) 'Vertical line 4
    Me.Line (4270, intLineTop)-(4270, intReportHeight) 'Vertical line 5
    Me.Line (5124, intLineTop)-(5124, intReportHeight) 'Vertical line 6
    Me.Line (5978, intLineTop)-(5978, intReportHeight) 'Vertical line 7
    Me.Line (6832, intLineTop)-(6832, intReportHeight) 'Vertical line 8
    Me.Line (7686, intLineTop)-(7686, intReportHeight) 'Vertical line 9
    Me.Line (8540, intLineTop)-(8540, intReportHeight) 'Vertical line 10
    Me.Line (9394, intLineTop)-(9394, intReportHeight) 'Vertical line 11
    Me.Line (10248, intLineTop)-(10248, intReportHeight) 'Vertical line 12
    Me.Line (11102, intLineTop)-(11102, intReportHeight) 'Vertical line 13
    Me.Line (11956, intLineTop)-(11956, intReportHeight) 'Vertical line 14
    Me.Line (12810, intLineTop)-(12810, intReportHeight) 'Vertical line 15
    Me.Line (13664, intLineTop)-(13664, intReportHeight) 'Vertical line 16

    '/// Draw Horizontal Lines
    Me.Line (10, 1130)-(intReportWidth, 1130) 'Horizontal line from top 1

    End Sub

    Hope you can help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts