Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make a report with fixed length "Detail" section? 2

Status
Not open for further replies.

cheapo

Programmer
Aug 19, 2003
16
ID
Hi,

I am having trouble making a report.
This particular report must be 1 page in length.
The format is the usual header-detail-footer.

I need to make a fixed position for header and footer at the top and bottom of the page respectivelly.
The details section occupies the middle of the page.. around 15cm.. the report can only contain a maximum of 15 entries in the details section.
(i.e. 1 cm for every entry)

When it has 15 entries it occupies all the 15cm of space in the details and when it's lesser(e.g. only 3 entries, it should only occupies the first 3 cm and leave the other 12cm of space blank... and the footer will still be at the bottom of the page.

Is it this possible to make such report?
Is there any special tricks?

Thanks In Advance.
 
HI Tom!
It's great works like magic!!!
Couldn't have done it without your help.... I really appreciate it!

Now I have my last Q, u ready?
:)

I have acctually done this myself, but the outcome seem to be different from what I expected!

Like I mentioned previously I made the print report button to automatically print twice.. it work, but now my end user wants me to make a check button on the form called "GST".
Here's how that button works:
If the GST checkbox is ticked and report is printed, both report will have the sum of the GST displayed in the both report(page 1 and 2).
The difficult part is that is the GST box is unticked and the report is printed, ONLY page 2 will have the GST sum printed and page 1 will have it's GST sum removed(invicible).

I have written the following code in the OnFormat details of the page footer section and many other combination, but still it does not work....
<i>
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
If Me.PrintCount = 1 And Forms![PUI].boxed = True Then
Me!Text259.Visible = True
ElseIf Me.PrintCount = 1 And Forms![PUI].boxed = False Then
Me!Text259.Visible = False
If Me.PrintCount = 2 And Forms![PUI].boxed = True Then
Me!Text259.Visible = True
ElseIf Me.PrintCount = 2 And Forms![PUI].boxed = False Then
Me!Text259.Visible = True
End If
End Sub
</i>
fyi, there is nothing wrong with the checkbox button called [boxed] as I have tested it before when I was still printing page by page.

Right now, when [boxed] is is ticked both pages displays GST sum and when it is unticked both GST sum are hidden.

For you convenience I'll repeat this again:
[boxed] ticked = both page dispaying GST sum.
[boxed] unticked = page 1 hides gst sum, page 2 still displays sum.
[boxed] is a checkbox in the form called [PUI].

I think my Access coding is not up to standard.... any hints?

Cheers,
Cheapo.
 
Gosh Tom,

I admire your perseverance in this thread, you deserve a lot of stars, unfortunately, I can only give you one.

Hope cheapo eventually gives you another.

Keep up the brilliant work.

Bill

 
Cheapo
I'll have a look and see if I can figure it out. Glad the first part works for you.

Bill
I have received so much help from other people that I am glad to be able to help someone else.

Tom
 
Thanks Tom.

Anyway... what stars are you guys refering to?
(I'm new in tek-tips...)
Can I give Tom a star?..... he deserves a planet!!!
 
Well, this was a tough nut to crack, but I finally got it.

I'm not sure why, but there seems to be some conflict between the PrintCount method and whether or not you can make a control visible. That may be why you couldn't make your code work.

Anyhow, here's what works for me...

Step 1
Put a check box on your report that checks to see whether or not your [boxed] is ticked on your PUI form. (In my example, my check box is called Check132). Hide this text box, making it invisible, so that it doesn't show on the report. It's for checking purposes only, so doesn't need to be seen.

Step 2
Put an unbound text box in the Page Footer and format it as currency. (In my example, my text box is called Text92)

Step 3
In the OnPrint event in your report page footer, put the following code
If Me.Text120 = &quot;Customer Copy&quot; And Me.Check132 = False Then
Me.Text92 = &quot;&quot;
Else
Me.Text92 = Me.Text78
End If

This text box, Text 92, in the footer checks Text120 to see if it is printing &quot;Accountant Copy&quot; or &quot;Customer Copy,&quot; as well as if Check132 is ticked or not. If Check132 is ticked, it will print the GST on both copies. If Check132 is not ticked, it will print the GST value on the Accountant Copy only and omit it from the Customer Copy.

If you want this printed on the Customer Copy rather than the Accountant Copy, you can just switch the values around to make it work according to your needs.

By the way, this may work on the OnFormat event. I didn't check that out, just worked with the OnPrint event, once I decided I couldn't do anything with the Visible properties and the PrintCount method.

Now, as for the stars that Bill was talking about, see where it says &quot;Mark this as a helpful post.&quot; That's the button that assigns stars. Don't worry about it in my case. I'm not looking for stars, just trying to be helpful.

Anyway, good luck with your report. You must be getting pretty much to the end of the design.

Tom


 
Tom!!!!!!!

Great work buddy!
I have now finished the sales part of my db.
I won't be bothering you anymore for a while now.... :)
Thanks for your time and patience for sure.

I've given you a star.... but I know you deserve more than that!

Cheers mate!
 
Glad to help.

Good luck with the rest of your project.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top