Blanl Lines

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PC Datasheet

    #1

    Blanl Lines

    How do you create blank lines with lines to fill such reports as invoices
    and purchase orders?

    Thanks!

    Marie


  • Honest Abe

    #2
    Re: Blanl Lines

    Steve,

    Take off the dress and the pantyhose because you're not fooling anyone with
    that 5 o’clock shadow. Stop masquerading as a woman so you can have a real
    expert write the answer for you so you can charge your customer the
    consultation fee for answering the question.

    Or maybe your customer "Marie" can purchase a copy of your collection of VBA
    code, available on CD for only $125! It's full of solutions like this,
    because you copied them from the experts here!

    Abe


    "PC Datasheet" <nospam@nospam. spam> wrote in message
    news:BYaNd.1241 $UX3.717@newsre ad3.news.pas.ea rthlink.net...[color=blue]
    > How do you create blank lines with lines to fill such reports as invoices
    > and purchase orders?
    >
    > Thanks!
    >
    > Marie
    >
    >[/color]


    Comment

    • Marshall Barton

      #3
      Re: Blanl Lines

      PC Datasheet wrote:
      [color=blue]
      >How do you create blank lines with lines to fill such reports as invoices
      >and purchase orders?[/color]

      The way I've done this is pretty messy. Try Googling the
      archives for previous threads on this problem.

      I'd Like to think there's a better way by using the Page
      event to execute the Line method. If you can't find
      something useful, post back and I'll see what I can work
      out.

      --
      Marsh
      MVP [MS Access]

      Comment

      • Marie

        #4
        Re: Blanl Lines

        Marsh,

        I appreciate your response!

        Here's an outline of what I used ---------------
        Data for my report comes from a query. The query includes the primary key
        and five fields from a table.
        1. Create TblBlankLine:
        TblBlankLine
        ARow
        A1
        A2
        A3
        A4
        A5
        Set ARow data type to long integer and A1 to A5 data types to match the
        data types of the fields in the query. ARow is numbered 5000001 to 5000028
        2. I needed a total of 28 records and blank lines in my report. Put the
        following in a standard module:
        Function BlankLines()
        Dim Items As Integer
        Items = DCount("*", "MyQuery")
        BlankLines = 28 - Items
        End Function
        3. Union MyQuery with TblBlankLine and include the Where clause:
        WHERE TblBlankLine.AR ow<=(BlankLines ()+5000000)
        4. Put the following in the ReportHeader_Fo rmat event:
        Call BlankLines

        When the report opens, BlankLines is calculated. The Union query returns 28
        records; whatever number of records from MyQuery and the remainder as blank
        lines. Note that the fields in the report must show their borders.

        Steve


        "Marshall Barton" <marshbarton@wo wway.com> wrote in message
        news:nkgb011m6g 40mag8j03ls39tc co7gov4rt@4ax.c om...[color=blue]
        > PC Datasheet wrote:
        >[color=green]
        > >How do you create blank lines with lines to fill such reports as invoices
        > >and purchase orders?[/color]
        >
        > The way I've done this is pretty messy. Try Googling the
        > archives for previous threads on this problem.
        >
        > I'd Like to think there's a better way by using the Page
        > event to execute the Line method. If you can't find
        > something useful, post back and I'll see what I can work
        > out.
        >
        > --
        > Marsh
        > MVP [MS Access][/color]


        Comment

        • Marshall Barton

          #5
          Re: Blanl Lines

          Marie wrote:[color=blue]
          >Here's an outline of what I used ---------------
          >Data for my report comes from a query. The query includes the primary key
          >and five fields from a table.
          >1. Create TblBlankLine:
          > TblBlankLine
          > ARow
          > A1
          > A2
          > A3
          > A4
          > A5
          > Set ARow data type to long integer and A1 to A5 data types to match the
          >data types of the fields in the query. ARow is numbered 5000001 to 5000028
          >2. I needed a total of 28 records and blank lines in my report. Put the
          >following in a standard module:
          >Function BlankLines()
          >Dim Items As Integer
          >Items = DCount("*", "MyQuery")
          >BlankLines = 28 - Items
          >End Function
          >3. Union MyQuery with TblBlankLine and include the Where clause:
          >WHERE TblBlankLine.AR ow<=(BlankLines ()+5000000)
          >4. Put the following in the ReportHeader_Fo rmat event:
          >Call BlankLines
          >
          >When the report opens, BlankLines is calculated. The Union query returns 28
          >records; whatever number of records from MyQuery and the remainder as blank
          >lines. Note that the fields in the report must show their borders.[/color]


          Thanks for posting back with your results. I think that's a
          better approach than either of the ones I was thinking of.

          Two minor questions:
          1 ) Why number the blank lines way up in the 5000000 range?
          That's a reasonable way if the invoice details are sorted by
          their key value (row number).

          2) Why do you call the BlankLines function in the Open
          event? I don't see where this does anything!?
          --
          Marsh
          MVP [MS Access]

          P.S. How about fixing your From and Sig? It's kind of
          confusing with all these different names.

          Comment

          • PC Datasheet

            #6
            Re: Blanl Lines

            See answers to questions below ---

            Steve


            "Marshall Barton" <marshbarton@wo wway.com> wrote in message
            news:mjpc01thcs 80slc9c8js2c442 hq54q4al1@4ax.c om...[color=blue]
            > Marie wrote:[color=green]
            > >Here's an outline of what I used ---------------
            > >Data for my report comes from a query. The query includes the primary key
            > >and five fields from a table.
            > >1. Create TblBlankLine:
            > > TblBlankLine
            > > ARow
            > > A1
            > > A2
            > > A3
            > > A4
            > > A5
            > > Set ARow data type to long integer and A1 to A5 data types to match[/color][/color]
            the[color=blue][color=green]
            > >data types of the fields in the query. ARow is numbered 5000001 to[/color][/color]
            5000028[color=blue][color=green]
            > >2. I needed a total of 28 records and blank lines in my report. Put the
            > >following in a standard module:
            > >Function BlankLines()
            > >Dim Items As Integer
            > >Items = DCount("*", "MyQuery")
            > >BlankLines = 28 - Items
            > >End Function
            > >3. Union MyQuery with TblBlankLine and include the Where clause:
            > >WHERE TblBlankLine.AR ow<=(BlankLines ()+5000000)
            > >4. Put the following in the ReportHeader_Fo rmat event:
            > >Call BlankLines
            > >
            > >When the report opens, BlankLines is calculated. The Union query returns[/color][/color]
            28[color=blue][color=green]
            > >records; whatever number of records from MyQuery and the remainder as[/color][/color]
            blank[color=blue][color=green]
            > >lines. Note that the fields in the report must show their borders.[/color]
            >
            >
            > Thanks for posting back with your results. I think that's a
            > better approach than either of the ones I was thinking of.
            >
            > Two minor questions:
            > 1 ) Why number the blank lines way up in the 5000000 range?
            > That's a reasonable way if the invoice details are sorted by
            > their key value (row number).[/color]

            ARow matches up to InvoiceID in the Union query. So the Where clause becomes
            a filter both to the InvoiceDetail records that are displayed as well as the
            blank records from TblBlank records that are displayed. The 5000000 range is
            insurance that no InvoiceDetail records get missed. If for example ARow in
            TblBlankLines was numbered 1 to 30 and the Where clause:
            WHERE TblBlankLine.AR ow<=(BlankLines ()+0)
            was used, any InvoiceDetail record with InvoiceID greater than
            (BlankLines()+0 ) would never get printed.
            [color=blue]
            >
            > 2) Why do you call the BlankLines function in the Open
            > event? I don't see where this does anything!?[/color]

            The BlankLines function is called in the ReportHeader_Fo rmat event. This
            calculates the value of BlankLines() used in the Where clause of the union
            query.

            [color=blue]
            > --
            > Marsh
            > MVP [MS Access]
            >
            > P.S. How about fixing your From and Sig? It's kind of
            > confusing with all these different names.[/color]


            Comment

            • Marshall Barton

              #7
              Re: Blanl Lines

              Continuing inline below
              --
              Marsh
              MVP [MS Access]


              PC Datasheet wrote:[color=blue]
              >See answers to questions below ---
              >[color=green]
              >> Marie wrote:[color=darkred]
              >> >Here's an outline of what I used ---------------
              >> >Data for my report comes from a query. The query includes the primary key
              >> >and five fields from a table.
              >> >1. Create TblBlankLine:
              >> > TblBlankLine
              >> > ARow
              >> > A1
              >> > A2
              >> > A3
              >> > A4
              >> > A5
              >> > Set ARow data type to long integer and A1 to A5 data types to match[/color][/color]
              >the[color=green][color=darkred]
              >> >data types of the fields in the query. ARow is numbered 5000001 to[/color][/color]
              >5000028[color=green][color=darkred]
              >> >2. I needed a total of 28 records and blank lines in my report. Put the
              >> >following in a standard module:
              >> >Function BlankLines()
              >> >Dim Items As Integer
              >> >Items = DCount("*", "MyQuery")
              >> >BlankLines = 28 - Items
              >> >End Function
              >> >3. Union MyQuery with TblBlankLine and include the Where clause:
              >> >WHERE TblBlankLine.AR ow<=(BlankLines ()+5000000)
              >> >4. Put the following in the ReportHeader_Fo rmat event:
              >> >Call BlankLines
              >> >
              >> >When the report opens, BlankLines is calculated. The Union query returns[/color][/color]
              >28[color=green][color=darkred]
              >> >records; whatever number of records from MyQuery and the remainder as[/color][/color]
              >blank[color=green][color=darkred]
              >> >lines. Note that the fields in the report must show their borders.[/color]
              >>
              >>[/color]
              >"Marshall Barton" wrote[color=green]
              >> Thanks for posting back with your results. I think that's a
              >> better approach than either of the ones I was thinking of.
              >>
              >> Two minor questions:
              >> 1 ) Why number the blank lines way up in the 5000000 range?
              >> That's a reasonable way if the invoice details are sorted by
              >> their key value (row number).[/color]
              >
              >ARow matches up to InvoiceID in the Union query. So the Where clause becomes
              >a filter both to the InvoiceDetail records that are displayed as well as the
              >blank records from TblBlank records that are displayed. The 5000000 range is
              >insurance that no InvoiceDetail records get missed. If for example ARow in
              >TblBlankLine s was numbered 1 to 30 and the Where clause:
              >WHERE TblBlankLine.AR ow<=(BlankLines ()+0)
              >was used, any InvoiceDetail record with InvoiceID greater than
              >(BlankLines()+ 0) would never get printed.[/color]

              Gotch ya.

              [color=blue][color=green]
              >> 2) Why do you call the BlankLines function in the Open
              >> event? I don't see where this does anything!?[/color]
              >
              >The BlankLines function is called in the ReportHeader_Fo rmat event. This
              >calculates the value of BlankLines() used in the Where clause of the union
              >query.[/color]

              But you call the function from the query, so calling it
              again later doesn't affect the query.

              If your invoice could possible go to more than one page and
              you still need to fill out the last page, change the
              function to use:

              Items = DCount("*", "MyQuery") Mod 28

              You came up with a nice approach here Steve and I'm glad I
              stumbled into it.

              Comment

              • PC Datasheet

                #8
                Re: Blanl Lines

                <<But you call the function from the query, so calling it
                again later doesn't affect the query.>>

                I see your point and I'm going to test it out!

                <<If your invoice could possible go to more than one page and
                you still need to fill out the last page, change the
                function to use:

                Items = DCount("*", "MyQuery") Mod 28>>

                Won't usually work because pages after page 1 usually don't have the report
                header so more than 28 total lines will fit on the page.

                In my current case I knew there would never be more than one page. However
                when there is a possibility of the report being two pages but not more, you
                might use something like this in the BlankLines function:
                Items = DCount("*", "MyQuery")
                Select Case Items
                Case <= 28
                BlankLines = 28 - Items
                Case Else
                BlankLines = 70 - Items
                End Select

                Here's something else I picked up off www.mvps.org/access that you might
                want to use:
                DoCmd.OpenRepor t "MyReport", acViewPreview
                DoCmd.Maximize
                Reports!MyRepor t.ZoomControl = 90

                Your report will open at 90% magnification which is a perfect fit in the
                report window.

                Marsh,

                I have always had a great respect for you from watching your responses to
                posts. You have gained another big notch in my respect for you for your
                courteous and professional response in this thread! I look forward to
                continuing watching your answers to posts.

                Steve




                "Marshall Barton" <marshbarton@wo wway.com> wrote in message
                news:nc7d01h1jm hckmksr68t8kjep vajqdesaf@4ax.c om...[color=blue]
                > Continuing inline below
                > --
                > Marsh
                > MVP [MS Access]
                >
                >
                > PC Datasheet wrote:[color=green]
                > >See answers to questions below ---
                > >[color=darkred]
                > >> Marie wrote:
                > >> >Here's an outline of what I used ---------------
                > >> >Data for my report comes from a query. The query includes the primary[/color][/color][/color]
                key[color=blue][color=green][color=darkred]
                > >> >and five fields from a table.
                > >> >1. Create TblBlankLine:
                > >> > TblBlankLine
                > >> > ARow
                > >> > A1
                > >> > A2
                > >> > A3
                > >> > A4
                > >> > A5
                > >> > Set ARow data type to long integer and A1 to A5 data types to[/color][/color][/color]
                match[color=blue][color=green]
                > >the[color=darkred]
                > >> >data types of the fields in the query. ARow is numbered 5000001 to[/color]
                > >5000028[color=darkred]
                > >> >2. I needed a total of 28 records and blank lines in my report. Put[/color][/color][/color]
                the[color=blue][color=green][color=darkred]
                > >> >following in a standard module:
                > >> >Function BlankLines()
                > >> >Dim Items As Integer
                > >> >Items = DCount("*", "MyQuery")
                > >> >BlankLines = 28 - Items
                > >> >End Function
                > >> >3. Union MyQuery with TblBlankLine and include the Where clause:
                > >> >WHERE TblBlankLine.AR ow<=(BlankLines ()+5000000)
                > >> >4. Put the following in the ReportHeader_Fo rmat event:
                > >> >Call BlankLines
                > >> >
                > >> >When the report opens, BlankLines is calculated. The Union query[/color][/color][/color]
                returns[color=blue][color=green]
                > >28[color=darkred]
                > >> >records; whatever number of records from MyQuery and the remainder as[/color]
                > >blank[color=darkred]
                > >> >lines. Note that the fields in the report must show their borders.
                > >>
                > >>[/color]
                > >"Marshall Barton" wrote[color=darkred]
                > >> Thanks for posting back with your results. I think that's a
                > >> better approach than either of the ones I was thinking of.
                > >>
                > >> Two minor questions:
                > >> 1 ) Why number the blank lines way up in the 5000000 range?
                > >> That's a reasonable way if the invoice details are sorted by
                > >> their key value (row number).[/color]
                > >
                > >ARow matches up to InvoiceID in the Union query. So the Where clause[/color][/color]
                becomes[color=blue][color=green]
                > >a filter both to the InvoiceDetail records that are displayed as well as[/color][/color]
                the[color=blue][color=green]
                > >blank records from TblBlank records that are displayed. The 5000000 range[/color][/color]
                is[color=blue][color=green]
                > >insurance that no InvoiceDetail records get missed. If for example ARow[/color][/color]
                in[color=blue][color=green]
                > >TblBlankLine s was numbered 1 to 30 and the Where clause:
                > >WHERE TblBlankLine.AR ow<=(BlankLines ()+0)
                > >was used, any InvoiceDetail record with InvoiceID greater than
                > >(BlankLines()+ 0) would never get printed.[/color]
                >
                > Gotch ya.
                >
                >[color=green][color=darkred]
                > >> 2) Why do you call the BlankLines function in the Open
                > >> event? I don't see where this does anything!?[/color]
                > >
                > >The BlankLines function is called in the ReportHeader_Fo rmat event. This
                > >calculates the value of BlankLines() used in the Where clause of the[/color][/color]
                union[color=blue][color=green]
                > >query.[/color]
                >
                > But you call the function from the query, so calling it
                > again later doesn't affect the query.
                >
                > If your invoice could possible go to more than one page and
                > you still need to fill out the last page, change the
                > function to use:
                >
                > Items = DCount("*", "MyQuery") Mod 28
                >
                > You came up with a nice approach here Steve and I'm glad I
                > stumbled into it.[/color]


                Comment

                • Honest Abe

                  #9
                  Re: Blanl Lines

                  Steve,

                  See? You’ll get offers to help you when you post a question as Steve the
                  Access developer, instead of posing as a woman who needs help with her
                  Access database. You got quality feedback that was targeted to your level of
                  expertise, not basic instructions on how to proceed based on someone's guess
                  about your experience level. Marsh didn't have to spend extra time writing
                  stuff you didn't need, but that he probably would have given to someone
                  assumed to be less experienced than you are. You should always post as Steve
                  Santus or PC Datasheet so people know how best to help you without wasting
                  their time or yours.

                  I count 70 messages you've posted in the NGs in the last three months while
                  you've pretended to be other people, mainly women. I doubt that's anywhere
                  near the actual number of your covert posts. You masquerade as so many
                  different people so that you can get experts to unknowingly write the step
                  by step instructions for you to copy, and then you charge your customers for
                  these written instructions without compensating the guys who did the actual
                  work. The next time I see you doing that I will point it out to everybody,
                  especially if I see you wearing a dress and high heels again so everybody
                  else can laugh at you too.

                  Abe

                  "PC Datasheet" <nospam@nospam. spam> wrote in message
                  news:A_BNd.2138 $UX3.1693@newsr ead3.news.pas.e arthlink.net...[color=blue]
                  > <<But you call the function from the query, so calling it
                  > again later doesn't affect the query.>>
                  >
                  > I see your point and I'm going to test it out!
                  >
                  > <<If your invoice could possible go to more than one page and
                  > you still need to fill out the last page, change the
                  > function to use:
                  >
                  > Items = DCount("*", "MyQuery") Mod 28>>
                  >
                  > Won't usually work because pages after page 1 usually don't have the[/color]
                  report[color=blue]
                  > header so more than 28 total lines will fit on the page.
                  >[/color]

                  -snip-
                  [color=blue]
                  >
                  > Marsh,
                  >
                  > I have always had a great respect for you from watching your responses to
                  > posts. You have gained another big notch in my respect for you for your
                  > courteous and professional response in this thread! I look forward to
                  > continuing watching your answers to posts.
                  >
                  > Steve[/color]

                  -snip-
                  [color=blue]
                  >"PC Datasheet" <nospam@nospam. spam> wrote in message
                  >news:BYaNd.124 1$UX3.717@newsr ead3.news.pas.e arthlink.net...[color=green]
                  >> How do you create blank lines with lines to fill such reports as invoices
                  >> and purchase orders?
                  >>
                  >> Thanks!
                  >>
                  >> Marie[/color][/color]


                  Comment

                  • PC Datasheet

                    #10
                    Re: Blanl Lines

                    And if you are so honest, why don't you use your real name? Practice what
                    you preach!


                    "Honest Abe" <NeverLie.To.Ho nestAbe@NeverBo x.comREMOVE_THI S> wrote in
                    message news:F4TNd.169$ uc.157@trnddc01 ...[color=blue]
                    > Steve,
                    >
                    > See? You’ll get offers to help you when you post a question as Steve the
                    > Access developer, instead of posing as a woman who needs help with her
                    > Access database. You got quality feedback that was targeted to your level[/color]
                    of[color=blue]
                    > expertise, not basic instructions on how to proceed based on someone's[/color]
                    guess[color=blue]
                    > about your experience level. Marsh didn't have to spend extra time writing
                    > stuff you didn't need, but that he probably would have given to someone
                    > assumed to be less experienced than you are. You should always post as[/color]
                    Steve[color=blue]
                    > Santus or PC Datasheet so people know how best to help you without wasting
                    > their time or yours.
                    >
                    > I count 70 messages you've posted in the NGs in the last three months[/color]
                    while[color=blue]
                    > you've pretended to be other people, mainly women. I doubt that's anywhere
                    > near the actual number of your covert posts. You masquerade as so many
                    > different people so that you can get experts to unknowingly write the step
                    > by step instructions for you to copy, and then you charge your customers[/color]
                    for[color=blue]
                    > these written instructions without compensating the guys who did the[/color]
                    actual[color=blue]
                    > work. The next time I see you doing that I will point it out to everybody,
                    > especially if I see you wearing a dress and high heels again so everybody
                    > else can laugh at you too.
                    >
                    > Abe
                    >
                    > "PC Datasheet" <nospam@nospam. spam> wrote in message
                    > news:A_BNd.2138 $UX3.1693@newsr ead3.news.pas.e arthlink.net...[color=green]
                    > > <<But you call the function from the query, so calling it
                    > > again later doesn't affect the query.>>
                    > >
                    > > I see your point and I'm going to test it out!
                    > >
                    > > <<If your invoice could possible go to more than one page and
                    > > you still need to fill out the last page, change the
                    > > function to use:
                    > >
                    > > Items = DCount("*", "MyQuery") Mod 28>>
                    > >
                    > > Won't usually work because pages after page 1 usually don't have the[/color]
                    > report[color=green]
                    > > header so more than 28 total lines will fit on the page.
                    > >[/color]
                    >
                    > -snip-
                    >[color=green]
                    > >
                    > > Marsh,
                    > >
                    > > I have always had a great respect for you from watching your responses[/color][/color]
                    to[color=blue][color=green]
                    > > posts. You have gained another big notch in my respect for you for your
                    > > courteous and professional response in this thread! I look forward to
                    > > continuing watching your answers to posts.
                    > >
                    > > Steve[/color]
                    >
                    > -snip-
                    >[color=green]
                    > >"PC Datasheet" <nospam@nospam. spam> wrote in message
                    > >news:BYaNd.124 1$UX3.717@newsr ead3.news.pas.e arthlink.net...[color=darkred]
                    > >> How do you create blank lines with lines to fill such reports as[/color][/color][/color]
                    invoices[color=blue][color=green][color=darkred]
                    > >> and purchase orders?
                    > >>
                    > >> Thanks!
                    > >>
                    > >> Marie[/color][/color]
                    >
                    >[/color]


                    Comment

                    • Honest Abe

                      #11
                      Re: Blanl Lines

                      My name is Abe de los Santos. Does my name have any meaning to you? It
                      doesn't because you don't know me. People know you though. Your reputation
                      has spread far and wide because you try to deceive and take advantage of so
                      many of the very generous people here.

                      And since I do practice what I preach, I'll be honest with you. You're
                      shameless. And you look terrible in a dress and pantyhose.

                      Abe

                      "PC Datasheet" <nospam@nospam. spam> wrote in message
                      news:CfTNd.2593 $UX3.2@newsread 3.news.pas.eart hlink.net...[color=blue]
                      > And if you are so honest, why don't you use your real name? Practice what
                      > you preach![/color]


                      Comment

                      Working...