Dynamic cross-tab (and report)
-
- Lounger
- Posts: 40
- Joined: 05 Nov 2014, 22:55
Re: Dynamic cross-tab (and report)
Ok I took the line out and it's perfect it pops up with the message there is no next item. Have a wonderful weekend
-
- Lounger
- Posts: 40
- Joined: 05 Nov 2014, 22:55
Re: Dynamic cross-tab (and report)
Hi Hans,
A few years ago you helped me with a dynamic report. My organization has been using it for almost two years. They would like for the print out of the report to page break for each contact. I attached a snip of the query, report and pdf. Do I need to code this page break or can it be done within the report. Thank you in advance.
Gina Flanagan
A few years ago you helped me with a dynamic report. My organization has been using it for almost two years. They would like for the print out of the report to page break for each contact. I attached a snip of the query, report and pdf. Do I need to code this page break or can it be done within the report. Thank you in advance.
Gina Flanagan
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78523
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Dynamic cross-tab (and report)
Open the report in design view.
Insert a page break control in the Detail section, and set its Top property to 0.
Set the name of the page break control to PageBreak.
Create an On Format event procedure for the Detail section:
Here, txtColumn1 is the name of the leftmost text box in the Detail section.
Insert a page break control in the Detail section, and set its Top property to 0.
Set the name of the page break control to PageBreak.
Create an On Format event procedure for the Detail section:
Code: Select all
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Static strContact As String
Me.PageBreak.Visible = Me.Controls(Me.txtColumn1.ControlSource) <> strContact
strContact = Me.Controls(Me.txtColumn1.ControlSource)
End Sub
Best wishes,
Hans
Hans
-
- Lounger
- Posts: 40
- Joined: 05 Nov 2014, 22:55
Re: Dynamic cross-tab (and report)
Run-time error '2465'
Microsoft Access can't find the field'=[contact] referred to in your expression.
Microsoft Access can't find the field'=[contact] referred to in your expression.
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78523
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Dynamic cross-tab (and report)
Try this instead:
Code: Select all
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Static strContact As String
Me.PageBreak.Visible = (Me.txtColumn1 <> strContact)
strContact = Me.txtColumn1
End Sub
Best wishes,
Hans
Hans
-
- Lounger
- Posts: 40
- Joined: 05 Nov 2014, 22:55
Re: Dynamic cross-tab (and report)
Great!!! Thank you so much it worked!!!