Tags: access, cant, database, draw, figureout, horiziontal, horizontal, lines, microsoft, mysql, oracle, rectangle, sql, tool, vertical

Horizontal lines

On Database » Microsoft Access

18,574 words with 9 Comments; publish: Sat, 07 Jun 2008 21:13:00 GMT; (25089.84, « »)

Hi. I'm using the rectangle tool to draw vertical lines, but I can't figure

out how to add to it to draw horiziontal lines as well. I'd appreciate your

help- Thanks.

All Comments

Leave a comment...

  • 9 Comments
    • Are you using Microsoft Access (a relational database program)? If so,

      there is in the toolbox a line tool. If not, you are asking the question in

      the wrong place.

      "Stephanie" <Stephanie.ms-access.questionfor.info.discussions.microsoft.com> wrote in message

      news:61D42502-EA89-4D51-8628-09C0ED4C7676.ms-access.questionfor.info.microsoft.com...

      > Hi. I'm using the rectangle tool to draw vertical lines, but I can't

      > figure

      > out how to add to it to draw horiziontal lines as well. I'd appreciate

      > your

      > help- Thanks.

      #1; Sat, 07 Jun 2008 21:15:00 GMT
    • Stephanie wrote:

      >Hi. I'm using the rectangle tool to draw vertical lines, but I can't figure

      >out how to add to it to draw horiziontal lines as well.

      I don't understand. A rectangle consists of both horizontal

      as well as vertical lines.

      Just in case you missed it there is also a Line tool that

      can be used to place a line at any angle.

      Marsh

      MVP [MS Access]

      #2; Sat, 07 Jun 2008 21:16:00 GMT
    • Sorry for being cryptic. I can't use the line tool because lines drawn with

      it don't export to RTF. So I need to use vba code to draw the lines.

      Duane H. published code that I've used for vertical lines. I have

      rectangles called Rect1 through Rect9. The code draws vertical lines from

      the top, left-hand corner of the rectangles down from page header to footer.

      But I can't seem to make horizontal lines with the code as well and would

      appreciate coding help. Thanks:

      Private Sub Report_Page()

      Dim intRects As Integer

      Dim intPageHeadHeight As Integer

      Dim intPageFootHeight As Integer

      Dim intRptHeadHeight As Integer

      Dim intLineBottom As Integer

      Dim intLeft As Integer

      Dim intTop As Integer

      On Error GoTo Report_Page_Error

      intRptHeadHeight = Me.Section(1).Height

      intPageHeadHeight = Me.Section(3).Height

      intPageFootHeight = Me.Section(4).Height

      'find the y point of the bottom of line

      intLineBottom = (11 * 1440) - _

      (intPageFootHeight) - _

      1440 'replace 1440 with total top and bottom margins

      For intRects = 1 To 9

      intLeft = Me("Rect" & intRects).Left

      intTop = Me("Rect" & intRects).Top

      If [Page] = 1 Then

      intTop = intTop + intRptHeadHeight

      End If

      Me.Line (intLeft, intTop)- _

      (intLeft, intLineBottom)

      Next

      On Error GoTo 0

      Exit Sub

      Report_Page_Error:

      Select Case Err

      Case 2462 'no page header

      intPageHeadHeight = 0

      Resume Next

      End Select

      MsgBox "Error " & Err.Number & " (" & _

      Err.Description & ") in procedure " & _

      "Report_Page of VBA Document Report_Report1"

      End Sub

      "Marshall Barton" wrote:

      > Stephanie wrote:

      >

      > I don't understand. A rectangle consists of both horizontal

      > as well as vertical lines.

      > Just in case you missed it there is also a Line tool that

      > can be used to place a line at any angle.

      > --

      > Marsh

      > MVP [MS Access]

      >

      #3; Sat, 07 Jun 2008 21:17:00 GMT
    • Stephanie wrote:

      >Sorry for being cryptic. I can't use the line tool because lines drawn with

      >it don't export to RTF. So I need to use vba code to draw the lines.

      >Duane H. published code that I've used for vertical lines. I have

      >rectangles called Rect1 through Rect9. The code draws vertical lines from

      >the top, left-hand corner of the rectangles down from page header to footer.

      >But I can't seem to make horizontal lines with the code as well and would

      >appreciate coding help. Thanks:

      >Private Sub Report_Page()

      > Dim intRects As Integer

      > Dim intPageHeadHeight As Integer

      > Dim intPageFootHeight As Integer

      > Dim intRptHeadHeight As Integer

      > Dim intLineBottom As Integer

      > Dim intLeft As Integer

      > Dim intTop As Integer

      > On Error GoTo Report_Page_Error

      > intRptHeadHeight = Me.Section(1).Height

      > intPageHeadHeight = Me.Section(3).Height

      > intPageFootHeight = Me.Section(4).Height

      > 'find the y point of the bottom of line

      > intLineBottom = (11 * 1440) - _

      > (intPageFootHeight) - _

      > 1440 'replace 1440 with total top and bottom margins

      > For intRects = 1 To 9

      > intLeft = Me("Rect" & intRects).Left

      > intTop = Me("Rect" & intRects).Top

      > If [Page] = 1 Then

      > intTop = intTop + intRptHeadHeight

      > End If

      > Me.Line (intLeft, intTop)- _

      > (intLeft, intLineBottom)

      > Next

      > On Error GoTo 0

      > Exit Sub

      >Report_Page_Error:

      > Select Case Err

      > Case 2462 'no page header

      > intPageHeadHeight = 0

      > Resume Next

      > End Select

      > MsgBox "Error " & Err.Number & " (" & _

      > Err.Description & ") in procedure " & _

      > "Report_Page of VBA Document Report_Report1"

      >End Sub

      You need to specify the right side of the rectangle. Perhaps

      just:

      intWidth = Me("Rect" & intRects).Width

      . . .

      Me.Line (intLeft,intTop)-(intLeft+intWidth,intLineBottom)

      But I won't garantee that Word can handle these lines any

      better than regular line controls.

      Marsh

      MVP [MS Access]

      #4; Sat, 07 Jun 2008 21:18:00 GMT
    • Marsh,

      Thanks for the reply. Actually I have exported to RTF using Stephen Lebans'

      utility that embeds the output of Snapshot Format inside an RTF file and it

      does show my vertical lines that were written using vba, but not those made

      with the line drawing tool.

      I tried your suggestion for horizontal lines but was only able to draw

      double vertical lines. Basically, I want Rect1...Rect9 to draw only vertical

      lines. And I'd like, say, Rect11 and Rect12 to only draw horizontal lines.

      Now I'm just floundering around. I managed to draw a double vertical line

      for Rect11 and just show a rectangle itself for Rect12.

      I'd appreciate suggstions. Thanks.

      Private Sub Report_Page()

      Dim intRects As Integer

      Dim intPageHeadHeight As Integer

      Dim intPageFootHeight As Integer

      Dim intRptHeadHeight As Integer

      Dim intLineBottom As Integer

      Dim intLeft As Integer

      Dim intTop As Integer

      Dim intWidth As Integer

      On Error GoTo Report_Page_Error

      intRptHeadHeight = Me.Section(1).Height

      intPageHeadHeight = Me.Section(3).Height

      intPageFootHeight = Me.Section(4).Height

      'find the y point of the bottom of line

      intLineBottom = (11 * 1440) - _

      (intPageFootHeight) - _

      1440 'replace 1440 with total top and bottom margins

      For intRects = 1 To 9

      intLeft = Me("Rect" & intRects).Left

      intTop = Me("Rect" & intRects).Top

      If [Page] = 1 Then

      intTop = intTop + intRptHeadHeight

      End If

      Me.Line (intLeft, intTop)-(intLeft, intLineBottom)

      Next

      For intRects = 11 To 12

      intWidth = Me("Rect" & intRects).Width

      ' If [Page] = 1 Then

      ' intWidth = intWidth + intRptHeadHeight 'no idea

      ' End If

      Me.Line (intLeft, intTop)-(intLeft + intWidth, intLineBottom)

      Next

      "Marshall Barton" wrote:

      > Stephanie wrote:

      >

      > You need to specify the right side of the rectangle. Perhaps

      > just:

      > intWidth = Me("Rect" & intRects).Width

      > . . .

      > Me.Line (intLeft,intTop)-(intLeft+intWidth,intLineBottom)

      > But I won't garantee that Word can handle these lines any

      > better than regular line controls.

      > --

      > Marsh

      > MVP [MS Access]

      >

      #5; Sat, 07 Jun 2008 21:19:00 GMT
    • I should be more precise. Use:

      Me.Line (intLeft,intTop)-(intLeft+intWidth,intLineBottom),,B

      to draw rectangles.

      Me.Line (intLeft,intTop)-(intLeft,intLineBottom)

      to draw vertical lines at the intLeft position. This is

      what you already have for rect 1 - 9

      Me.Line (intLeft,intTop)-(intLeft+intWidth,intTop)

      to draw intWidth long horizontal lines at the intTop

      position. I'm still not sure about how long you want the

      lines, but I think this is what you want for rect 11 - 12

      Marsh

      MVP [MS Access]

      Stephanie wrote:[vbcol=seagreen]

      >Thanks for the reply. Actually I have exported to RTF using Stephen Lebans'

      >utility that embeds the output of Snapshot Format inside an RTF file and it

      >does show my vertical lines that were written using vba, but not those made

      >with the line drawing tool.

      >I tried your suggestion for horizontal lines but was only able to draw

      >double vertical lines. Basically, I want Rect1...Rect9 to draw only vertical

      >lines. And I'd like, say, Rect11 and Rect12 to only draw horizontal lines.

      >Now I'm just floundering around. I managed to draw a double vertical line

      >for Rect11 and just show a rectangle itself for Rect12.

      >Private Sub Report_Page()

      > Dim intRects As Integer

      > Dim intPageHeadHeight As Integer

      > Dim intPageFootHeight As Integer

      > Dim intRptHeadHeight As Integer

      > Dim intLineBottom As Integer

      > Dim intLeft As Integer

      > Dim intTop As Integer

      > Dim intWidth As Integer

      > On Error GoTo Report_Page_Error

      > intRptHeadHeight = Me.Section(1).Height

      > intPageHeadHeight = Me.Section(3).Height

      > intPageFootHeight = Me.Section(4).Height

      > 'find the y point of the bottom of line

      > intLineBottom = (11 * 1440) - _

      > (intPageFootHeight) - _

      > 1440 'replace 1440 with total top and bottom margins

      > For intRects = 1 To 9

      > intLeft = Me("Rect" & intRects).Left

      > intTop = Me("Rect" & intRects).Top

      > If [Page] = 1 Then

      > intTop = intTop + intRptHeadHeight

      > End If

      > Me.Line (intLeft, intTop)-(intLeft, intLineBottom)

      > Next

      > For intRects = 11 To 12

      > intWidth = Me("Rect" & intRects).Width

      > ' If [Page] = 1 Then

      > ' intWidth = intWidth + intRptHeadHeight 'no idea

      > ' End If

      > Me.Line (intLeft, intTop)-(intLeft + intWidth, intLineBottom)

      > Next

      >

      >"Marshall Barton" wrote:

      #6; Sat, 07 Jun 2008 21:20:00 GMT
    • Marsh, thanks for the reply. I'm having limited success. Now, I'm trying to

      draw a horizontal line for my subreport, no vertical lines involved, trying

      to just figure out horizontal lines. My subreport contains only a details

      section. It lists all of my "opportunities" in a single column (this is for

      a calendar report). I was using a drawn line to separate the opportunities.

      Now I'm trying to draw a horizontal line in code.

      I was able to draw one horizontal line across the top of the opportunities

      and then the same rectangle that was used to draw the line appeared as a

      rectangle "separating" the opportunities, but didn't draw a line. What I

      want are horizontal lines separating each opportunity:

      Opportunity1

      time

      place

      other stuff

      Opportunity2

      time

      place

      other stuff

      Opportunity3...

      Here, the width of the line is 1.5" wide. How can I get the rectangle tool

      to repeat the horizontal line between each record? Thanks for the help.

      Private Sub Report_Page()

      Dim intRects As Integer

      Dim intPageHeadHeight As Integer

      Dim intPageFootHeight As Integer

      Dim intRptHeadHeight As Integer

      Dim intLineBottom As Integer

      Dim intLeft As Integer

      Dim intTop As Integer

      Dim intWidth As Integer

      On Error GoTo Report_Page_Error

      intRptHeadHeight = Me.Section(1).Height

      intPageHeadHeight = Me.Section(3).Height

      intPageFootHeight = Me.Section(4).Height

      'find the y point of the bottom of line

      intLineBottom = (11 * 1440) - _

      (intPageFootHeight) - _

      1440 'replace 1440 with total top and bottom margins

      For intRects = 1 To 1

      intWidth = Me("Rect" & intRects).Width

      'If [Page] = 1 Then

      intWidth = intWidth + (1.5 * 1400)

      'End If

      Me.Line (intLeft, intTop)-(intLeft + intWidth, intTop)

      Next

      On Error GoTo 0

      Exit Sub

      "Marshall Barton" wrote:

      > I should be more precise. Use:

      > Me.Line (intLeft,intTop)-(intLeft+intWidth,intLineBottom),,B

      > to draw rectangles.

      > Me.Line (intLeft,intTop)-(intLeft,intLineBottom)

      > to draw vertical lines at the intLeft position. This is

      > what you already have for rect 1 - 9

      > Me.Line (intLeft,intTop)-(intLeft+intWidth,intTop)

      > to draw intWidth long horizontal lines at the intTop

      > position. I'm still not sure about how long you want the

      > lines, but I think this is what you want for rect 11 - 12

      > --

      > Marsh

      > MVP [MS Access]

      >

      > Stephanie wrote:

      >

      #7; Sat, 07 Jun 2008 21:21:00 GMT
    • There are no "Page" events or sections on subreports. If you want to draw a

      horizontal line at the bottom of the bottom control in a detail section of a

      subreport, add code to the On Print event of the section. This code assumes

      your bottom-most control name is "txtLastTB".

      Private Sub Detail_Print(Cancel As Integer, _

      PrintCount As Integer)

      Dim intBottom As Integer

      intBottom = Me.txtLastTB.Top + Me.txtLastTB.Height

      Me.Line (0, intBottom)-Step(Me.Width, 0)

      End Sub

      Duane Hookom

      MS Access MVP

      "Stephanie" <Stephanie.ms-access.questionfor.info.discussions.microsoft.com> wrote in message

      news:BDC3F77B-F706-4A29-92A5-8CC938B999DA.ms-access.questionfor.info.microsoft.com...[vbcol=seagreen]

      > Marsh, thanks for the reply. I'm having limited success. Now, I'm trying

      > to

      > draw a horizontal line for my subreport, no vertical lines involved,

      > trying

      > to just figure out horizontal lines. My subreport contains only a details

      > section. It lists all of my "opportunities" in a single column (this is

      > for

      > a calendar report). I was using a drawn line to separate the

      > opportunities.

      > Now I'm trying to draw a horizontal line in code.

      > I was able to draw one horizontal line across the top of the opportunities

      > and then the same rectangle that was used to draw the line appeared as a

      > rectangle "separating" the opportunities, but didn't draw a line. What I

      > want are horizontal lines separating each opportunity:

      > Opportunity1

      > time

      > place

      > other stuff

      > --

      > Opportunity2

      > time

      > place

      > other stuff

      > --

      > Opportunity3...

      > Here, the width of the line is 1.5" wide. How can I get the rectangle

      > tool

      > to repeat the horizontal line between each record? Thanks for the help.

      > Private Sub Report_Page()

      > Dim intRects As Integer

      > Dim intPageHeadHeight As Integer

      > Dim intPageFootHeight As Integer

      > Dim intRptHeadHeight As Integer

      > Dim intLineBottom As Integer

      > Dim intLeft As Integer

      > Dim intTop As Integer

      > Dim intWidth As Integer

      > On Error GoTo Report_Page_Error

      > intRptHeadHeight = Me.Section(1).Height

      > intPageHeadHeight = Me.Section(3).Height

      > intPageFootHeight = Me.Section(4).Height

      > 'find the y point of the bottom of line

      > intLineBottom = (11 * 1440) - _

      > (intPageFootHeight) - _

      > 1440 'replace 1440 with total top and bottom margins

      > For intRects = 1 To 1

      > intWidth = Me("Rect" & intRects).Width

      > 'If [Page] = 1 Then

      > intWidth = intWidth + (1.5 * 1400)

      > 'End If

      > Me.Line (intLeft, intTop)-(intLeft + intWidth, intTop)

      > Next

      > On Error GoTo 0

      > Exit Sub

      > "Marshall Barton" wrote:

      #8; Sat, 07 Jun 2008 21:22:00 GMT
    • Stephanie, it looks like you are just using copy/paste on a

      bunch of code without getting a grip on the principles. As

      Duane said, all the code having to do with page numbers and

      page size has nothing to do with either subreports or what

      you want to do in the subreport. Get rid of it.

      Another thing I see is that you never set intLeft, but since

      its supposed to be 0, you do not really need it.

      I'm pretty sure that after getting rid of all that useless

      code, you will only need the one line that Duane posted.

      Marsh

      MVP [MS Access]

      Stephanie wrote:[vbcol=seagreen]

      >Marsh, thanks for the reply. I'm having limited success. Now, I'm trying to

      >draw a horizontal line for my subreport, no vertical lines involved, trying

      >to just figure out horizontal lines. My subreport contains only a details

      >section. It lists all of my "opportunities" in a single column (this is for

      >a calendar report). I was using a drawn line to separate the opportunities.

      >Now I'm trying to draw a horizontal line in code.

      >I was able to draw one horizontal line across the top of the opportunities

      >and then the same rectangle that was used to draw the line appeared as a

      >rectangle "separating" the opportunities, but didn't draw a line. What I

      >want are horizontal lines separating each opportunity:

      >Opportunity1

      >time

      >place

      >other stuff

      >--

      >Opportunity2

      >time

      >place

      >other stuff

      >--

      >Opportunity3...

      >Here, the width of the line is 1.5" wide. How can I get the rectangle tool

      >to repeat the horizontal line between each record? Thanks for the help.

      >Private Sub Report_Page()

      > Dim intRects As Integer

      > Dim intPageHeadHeight As Integer

      > Dim intPageFootHeight As Integer

      > Dim intRptHeadHeight As Integer

      > Dim intLineBottom As Integer

      > Dim intLeft As Integer

      > Dim intTop As Integer

      > Dim intWidth As Integer

      > On Error GoTo Report_Page_Error

      > intRptHeadHeight = Me.Section(1).Height

      > intPageHeadHeight = Me.Section(3).Height

      > intPageFootHeight = Me.Section(4).Height

      > 'find the y point of the bottom of line

      > intLineBottom = (11 * 1440) - _

      > (intPageFootHeight) - _

      > 1440 'replace 1440 with total top and bottom margins

      > For intRects = 1 To 1

      > intWidth = Me("Rect" & intRects).Width

      > 'If [Page] = 1 Then

      > intWidth = intWidth + (1.5 * 1400)

      > 'End If

      > Me.Line (intLeft, intTop)-(intLeft + intWidth, intTop)

      > Next

      > On Error GoTo 0

      > Exit Sub

      >"Marshall Barton" wrote:

      #9; Sat, 07 Jun 2008 21:23:00 GMT