Re: Multi-Column Report - Add a border and line between columns

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thank you. I will try to complete the code. Best regards.

james

"Duane Hookom" wrote:

> You can use code in the On Print event to loop through all controls in the
> detail section and draw lines beginning from
> (ctl.Left, ctl.Top+ctl.Height) - Step(ctl.Width,0)
>
> --
> Duane Hookom
> MS Access MVP
>
>
> "james" <james@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:8B144D9F-628E-4162-BC6A-C3A8B56071EF@xxxxxxxxxxxxxxxx
> >I found the reason as to why we had different results. The lines were there
> > if I were to create the report in tabular format.
> >
> > However, I made my report in columnar format and limited the number of
> > rows
> > displayed. Consequently, I had only one line drew at the bottom. %-((
> >
> > I had to use the columnar format because I had 17 fields to display. The
> > page wouldn't have the length if I were to display it tabularly. The 4
> > columns to the right of the far left fields / labels would in fact be
> > records. Didn't mean to confuse the terms of fields and records. Never
> > thought of it along that perspective.
> >
> > What I did then, was in fact drawing lines underneath the fields / labels
> > on
> > the far left column to grid my report. What I was seeking then was a way
> > to
> > code in the lines underneath the fields / labels instant of using the line
> > icon.
> >
> > james
> >
> >
> >
> > "Duane Hookom" wrote:
> >
> >> The code I suggested does place a line at the bottom of each
> >> record/detail
> >> section. What are your results with using the code? What do you want
> >> changed
> >> from your results?
> >>
> >> --
> >> Duane Hookom
> >> MS Access MVP
> >> --
> >>
> >> "james" <james@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> news:9FB7F4D0-955F-40D1-ADAA-1B5ECBA41E9F@xxxxxxxxxxxxxxxx
> >> > Hello Duane:
> >> >
> >> > This may be a double reply. I did one last night, but do not see it
> >> > posted
> >> > as of now, my apology for any duplication.
> >> >
> >> > Yes, the lines (m-n, per diagram below) are there at the bottom of the
> >> > section. But what I had in mind was to draw horizontal lines across
> >> > underneath each record like lines c-d, e-f..., k-l.
> >> >
> >> > a _____________________________________________ b
> >> > | | Col-1 | Col-2 | Col-3 | Col-4 |
> >> > c |_________ |________| ________|________|_______| d
> >> > | Record-1 | | | | |
> >> > e |_________ |________| ________|________|_______| f
> >> > | Record-2 | | |
> >> > |
> >> > |
> >> > g |_________ |________| ________|________|_______| h
> >> > | To. | | |
> >> > |
> >> > |
> >> > i |_________ |________| ________|________|_______| j
> >> > | Record-16 | | |
> >> > |
> >> > |
> >> > k |_________ |________| ________|________|_______| l
> >> > | Record-17 | | |
> >> > |
> >> > |
> >> > m |_________ |________| ________|________|_______| n
> >> >
> >> >
> >> > At the moment, I achieved this grid table by using the line icon. I
> >> > drew
> >> > one
> >> > line under each record. It will be nice to do it by code.
> >> >
> >> > Thanks.
> >> >
> >> > James
> >> >
> >> >
> >> >
> >> > "Duane Hookom" wrote:
> >> >
> >> >> The horizontal line should be printed at the bottom of each detail
> >> >> section
> >> >> (my results). Isn't this what you wanted?
> >> >>
> >> >> --
> >> >> Duane Hookom
> >> >> MS Access MVP
> >> >> --
> >> >>
> >> >> "james" <james@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> >> news:CE908AC1-E87C-4FDE-BD79-8E2C5AFBAF57@xxxxxxxxxxxxxxxx
> >> >> > Sorry. I put it in the Objects-Reports-RptTest-Detail section-On
> >> >> > Print
> >> >> > event.
> >> >> > RptTest is my test report name.
> >> >> >
> >> >> > Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
> >> >> > Me.Line (0, Me.Height)-Step(Me.Width, 0), vbBlack
> >> >> > End Sub
> >> >> >
> >> >> > Thank you.
> >> >> >
> >> >> > james
> >> >> >
> >> >> > "Duane Hookom" wrote:
> >> >> >
> >> >> >> Where (what section and event) is your code located?
> >> >> >>
> >> >> >> --
> >> >> >> Duane Hookom
> >> >> >> MS Access MVP
> >> >> >>
> >> >> >>
> >> >> >> "james" <james@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> >> >> news:85219A82-B852-404B-ADDD-011DD4B7F6E0@xxxxxxxxxxxxxxxx
> >> >> >> > Thanks Duane. I was sucessful in putting the horizontal line by
> >> >> >> > code.
> >> >> >> >
> >> >> >> > Me.Line(0,Me.Height)-Step(Me.Width,0),vbBlack
> >> >> >> >
> >> >> >> > But it only draw a horizontal line at the bottom. Did I do
> >> >> >> > something
> >> >> >> > wrong?
> >> >> >> >
> >> >> >> > I was seeking a way by code, to line horizontally each columnar
> >> >> >> > report
> >> >> >> > record (I have 17 of these text boxes in each column of 5
> >> >> >> > columns).
> >> >> >> >
> >> >> >> > This is similar to the post by Bill at
> >> >> >> > "http://www.accessmonster.com/Uwe/Forum.aspx/access-reports/16833/Access-reports-with-a-horizontal-line-after-each-record";.
> >> >> >> > However, I wasn't able to view the code solution in his post.
> >> >> >> >
> >> >> >> > Currently, I am using the line icon to put them in place line by
> >> >> >> > line.
> >> >> >> > It
> >> >> >> > works OK. But a code solution will be better.
> >> >> >> >
> >> >> >> > Thank you in advance for your advice.
> >> >> >> >
> >> >> >> > james
> >> >> >> >
> >> >> >> > "Duane Hookom" wrote:
> >> >> >> >
> >> >> >> >> Add code to the On Print event of the detail section to draw a
> >> >> >> >> horizontal
> >> >> >> >> line at the bottom of the section.
> >> >> >> >>
> >> >> >> >> --
> >> >> >> >> Duane Hookom
> >> >> >> >> MS Access MVP
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> "james" <james@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> >> >> >> news:C38CD9CD-C1D6-4B12-B700-384F7BF48DC0@xxxxxxxxxxxxxxxx
> >> >> >> >> > Thanks for the code. It works great vertically.
> >> >> >> >> >
> >> >> >> >> > In my situation, I also want to put horizontal lines.
> >> >> >> >> > Basically,
> >> >> >> >> > I
> >> >> >> >> > want
> >> >> >> >> > to
> >> >> >> >> > use lines to separate a table of records in the report,
> >> >> >> >> > similar
> >> >> >> >> > to
> >> >> >> >> > an
> >> >> >> >> > excel
> >> >> >> >> > table. As of now, I use the line icon in the tool box.
> >> >> >> >> >
> >> >> >> >> > It will be nice to learn a smarter way. Thank you in advance.
> >> >> >> >> >
> >> >> >> >> > james
> >> >> >> >> >
> >> >> >> >> >
> >> >> >> >> > "Duane Hookom" wrote:
> >> >> >> >> >
> >> >> >> >> >> Private Sub Report_Page()
> >> >> >> >> >> Dim intLineCount As Integer
> >> >> >> >> >> Dim intColumnWidth As Integer
> >> >> >> >> >> Dim intReportHeight As Integer
> >> >> >> >> >> Dim intLineTop as Integer
> >> >> >> >> >> intLineTop = 1440
> >> >> >> >> >> intReportHeight = (9 * 1440)
> >> >> >> >> >> intColumnWidth = 2800
> >> >> >> >> >> For intLineCount = 0 To 4
> >> >> >> >> >> Me.Line (intLineCount * intColumnWidth,
> >> >> >> >> >> intLineTop)-Step(0,
> >> >> >> >> >> intReportHeight)
> >> >> >> >> >> Next
> >> >> >> >> >> Me.Line (0, intLineTop)-Step(4 * intColumnWidth,
> >> >> >> >> >> intReportHeight),
> >> >> >> >> >> ,
> >> >> >> >> >> B
> >> >> >> >> >> End Sub
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >> >> --
> >> >> >> >> >> Duane Hookom
> >> >> >> >> >> MS Access MVP
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >> >> "John" <John@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> >> >> >> >> news:81C46E1A-7069-4A8C-B990-FBCC5F299D55@xxxxxxxxxxxxxxxx
> >> >> >> >> >> > This works perfectly except I am confused on how I can make
> >> >> >> >> >> > the
> >> >> >> >> >> > rectangle
> >> >> >> >> >> > move down about an inch. I can't seem to figure that out.
> >> >> >> >> >> > Any
> >> >> >> >> >> > help
> >> >> >> >> >> > would
> >> >> >> >> >> > be
> >> >> >> >> >> > great.
> >> >> >> >> >> >
> >> >> >> >> >> > Thanks in advance
> >> >> >> >> >> >
> >> >> >> >> >> > "Duane Hookom" wrote:
> >> >> >> >> >> >
> >> >> >> >> >> >> You can add code like:
> >> >> >> >> >> >> Private Sub Report_Page()
> >> >> >> >> >> >> Dim intLineCount As Integer
> >> >> >> >> >> >> Dim intColumnWidth As Integer
> >> >> >> >> >> >> Dim intReportHeight As Integer
> >> >> >> >> >> >> intReportHeight = (9 * 1440)
> >> >> >> >> >> >> intColumnWidth = 2800
> >> >> >> >> >> >> For intLineCount = 0 To 4
> >> >> >> >> >> >> Me.Line (intLineCount * intColumnWidth, 0)-Step(0,
> >> >> >> >> >> >> intReportHeight)
> >> >> >> >> >> >> Next
> >> >> >> >> >> >> Me.Line (0, 0)-Step(4 * intColumnWidth,
> >> >> >> >> >> >> intReportHeight),
> >> >> >> >> >> >> ,
> >> >> >> >> >> >> B
> >> >> >> >> >> >> End Sub
> >> >> >> >> >> >>
> >> >> >> >> >> >> --
> >> >> >> >> >> >> Duane Hookom
> >> >> >> >> >> >> MS Access MVP
> >> >> >> >> >> >>
> >> >> >> >> >> >>
> >> >> >> >> >> >> "John" <John@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> >> >> >> >> >> news:B5BB554B-2AB9-4D1F-B6A6-E0C40537E4F3@xxxxxxxxxxxxxxxx
> >> >> >> >> >> >> > Does anyone know a way to put a border around a report
> >> >> >> >> >> >> > and
> >> >> >> >> >> >> > between
> >> >> >> >> >> >> > the
> >> >> >> >> >> >> > columns of a multi-column report? I tried just adding
> >> >> >> >> >> >> > the
> >> >> >> >> >> >> > lines
> >> >> >> >> >> >> > in
> >> >> >> >> >> >> > the
> >> >> >> >> >> >> > report detail and it did not give a line on the far
> >> >> >> >> >> >> > right
> >> >> >> >> >> >> > side
> >> >> >> >> >> >> > plus
> >> >> >> >> >> >> > the
> >> >> >> >> >> >> > border was not complete if there were not enough records
> >> >> >> >> >> >> > to
> >> >> >> >> >> >> > fill
> >> >> >> >> >> >> > the
> >> >> >> >> >> >> > whole
> >> >> >> >> >> >> > page.
> >> >> >> >> >> >> >
> >> >> >> >> >> >> > Thanks in advance,
> >> >> >> >> >> >> > John
> >> >> >> >> >> >>
> >> >> >> >> >> >>
> >> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >>
> >> >> >> >>
> >> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
.



Relevant Pages