access report detail size fixing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dev kamal
    New Member
    • Aug 2017
    • 5

    access report detail size fixing

    I created an accounting package. In invoice, I summed up in report footer. I have to show 10 detail section records . there are 3 cases.
    1 the bill has <10 records,
    2. bill has =10records,
    3.bill has >10 records.

    the detail.forcenew section=2 works fine with serial mod 10= 10 with if else statement . in 1 and 3 cases. but when there are exact 10 records, the report footer section goes to next page. .. I tried several if then else, if else select etc but noted that only first selection statement works then access' goes to sleep. I think access is lazy like me? Respected sir, I doubt I am missing something great. I am creating this great app for humanity. kindly show me the way.


    regards.... Er. Kamal dev

    code goes as:
    Code:
     in "report_page()" event===>
    if serial mod 10 =0 then
    detail.forcenewsection=2
    else
    detail.forcenewsection=0
    end if
    end sub
    I am using a5 page and .25,.25,.17,.33 3 l,r,b,t margins
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32633

    #2
    I get that if there are less than 10 items on the bill then there is no need for an extra page.
    I get that if there are exactly 10 items on the bill then there is no need for an extra page either.
    I'm not clear what you want if there are more than 10 items on the bill. Should it restrict it to showing just the 10? Should it run to another page?

    This is your first post so I can tell you're new here. Great that you post your code in the [CODE] tags. It's also important to copy Paste the code from your project where possible. This ensures all who read it have confidence it's exactly as you say. When it's typed in there are many occasions when people find a problem, then they are told it's not a problem as it was only a typo. No typos with copying/pasting. Everybody's happier.

    PS. Is that Dr. Kamal Dev or does Er. have a special meaning?

    Comment

    • dev kamal
      New Member
      • Aug 2017
      • 5

      #3
      I did it . I used counter at report footer as rowcounter, serial as first increment field of the detail and used following code kindly note all Access designers. this code is necessary for Invoice designing. " Access 2016.

      Code:
      Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
      If rowcount.Value <= 10 Then
      Detail.ForceNewPage = 0
      Else
      Detail.ForceNewPage = IIf(SERIAL Mod 10 = 0, 2, 0)
      End If
      end sub
      Er= Engineer(B. Tech)

      Comment

      • dev kamal
        New Member
        • Aug 2017
        • 5

        #4
        Furhter field in detail (=1) as serial and used them to bind 10 records in a5 sheet with TBLR margins (inches)= .336,.154,.19,. 19 landscape.





        well thanks for the reply..
        Last edited by dev kamal; Aug 27 '17, 05:06 PM. Reason: my laptop restarted and I thought I did not posted recently but now I look its already so I explained further

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32633

          #5
          You don't answer my questions about what you actually want, but I suspect you may be interested to know that each Section in a Form or Report has a .WillContinue property that may be what you really need.

          As your code is not copy/pasted (again) I can't even tell what the items SERIAL & rowcount refer to. The latter looks like it may be a property of something, but no properties are ever in all lower case, and the property isn't qualified. With reliable information I may have been able to deduce the answers to my questions for myself, and thus be able to help more. As it is, I'm left frustrated. Still not understanding what you've tried to ask for, in spite of my tips earlier on how to do it properly.

          You sound like you are trying to be polite so I'm happy to excuse you on this occasion. Please try to pay attention to responses in future though. It benefits you as much as the person trying to assist you.

          Comment

          Working...