By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,829 Members | 670 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,829 IT Pros & Developers. It's quick & easy.

access report detail size fixing

P: 5
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.forcenewsection=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:
Expand|Select|Wrap|Line Numbers
  1.  in "report_page()" event===>
  2. if serial mod 10 =0 then
  3. detail.forcenewsection=2
  4. else
  5. detail.forcenewsection=0
  6. end if
  7. end sub
I am using a5 page and .25,.25,.17,.333 l,r,b,t margins
Aug 27 '17 #1
Share this Question
Share on Google+
4 Replies

Expert Mod 15k+
P: 31,418
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?
Aug 27 '17 #2

P: 5
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.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2. If rowcount.Value <= 10 Then
  3. Detail.ForceNewPage = 0
  4. Else
  5. Detail.ForceNewPage = IIf(SERIAL Mod 10 = 0, 2, 0)
  6. End If
  7. end sub
Er= Engineer(B. Tech)
Aug 27 '17 #3

P: 5
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..
Aug 27 '17 #4

Expert Mod 15k+
P: 31,418
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.
Aug 27 '17 #5

Post your reply

Sign in to post your reply or Sign up for a free account.