Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.ms-access > #9787
| From | "Phil" <phil@stantonfamily.co.uk> |
|---|---|
| Newsgroups | comp.databases.ms-access |
| Subject | Re: 'Continued' label in Group Header when using Repeat Section - Solved |
| Date | 2014-08-14 18:57 +0100 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <lsitav$832$1@speranza.aioe.org> (permalink) |
| References | <00b5fb28-d596-4e1c-ad1e-68dc33078639@googlegroups.com> |
On 14/08/2014 14:55:06, wrote:
> I have an Access Report with information about each quote grouped by
> Custom er, so I have a Customer header that has column headings. I wanted
> the col umn headings to be at the top of each page of the report, so in
> the GroupHe ader0 properties I set the Repeat Section property to Yes.
> Then I decided that to the right of the Customer textbox in the customer
> header, I wanted to put a hidden label called lblContinue containing the
> caption '(Cont.)'. I wanted that label to be visible when the Customer
> Header started on a pr evious page, but not visible when it started at the
> top of that page. Here 's the code I used:
>
> '---begin code behind report
> Option Compare Database
> Option Explicit
>
> Dim boolPageHeader As Boolean
> Dim strCurrentCustomer As String
>
> Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
> 'If a specific customer is selected, show lblContinued after first page.
> If Not IsNull(Forms!frmAwardedReport!cbxCustomer.Value) Then If
> boolPageHeader = True And [Page] <> 1 Then lblContinued.Visible = True
> Else
> lblContinued.Visible = False
> End If
> Exit Sub
> End If
> If boolPageHeader = True And [Page] <> 1 Then
> lblContinued.Visible = True
> boolPageHeader = False
> Else
> lblContinued.Visible = False
> End If
> End Sub
>
> Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
> Inte ger)
> strCurrentCustomer = Nz(txtCustomer.Value, "")
> End Sub
>
> Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
> Inte ger)
> If [Page] = 1 Then Exit Sub
> If txtCustomer.Value = strCurrentCustomer Then
> boolPageHeader = True
> Else
> 'Fresh customer, so '(Cont.)' can't apply. Act like code isn't in header
> .
> boolPageHeader = False
> End If
> End Sub
>
> Private Sub Report_Open(Cancel As Integer)
> If Not IsFormOpen("frmAwardedReport") Then
> MsgBox ("This form must be opened from the Awarded Report form.")
> Cancel = True
> Exit Sub
> End If
> boolPageHeader = False
> lblDateRange.Caption = "Submitted Dates from " & Format(Forms!frmAwardedR
> eport!txtStartDate.Value, "m/d/yy") & " to " &
> Format(Forms!frmAwardedRepor t!txtEndDate.Value, "m/d/yy")
> If Not IsNull(Forms!frmAwardedReport!cbxCustomer.Value) Then
> 'Me.RecordSource = "SQL to get quotes for specific customer"
> Else
> 'Me.RecordSource = "SQL to get quotes for all customers"
> End If
> End Sub
> '-----end code behind report
>
> '---begin module code
> Public Function IsFormOpen(strForm As String) As Boolean
> Dim frmX As Form
>
> IsFormOpen = False
> For Each frmX In Forms
> If frmX.Name = strForm Then
> IsFormOpen = True
> Exit For
> End If
> Next frmX
> End Function
> '-----end module code
>
> James A. Fortune
> CDMAPoster@FortuneJames.com
>
Try this (Sorry, [Type] is the groupheader field name - yes I know Type is a
reserved word...) The field Type is Visible = No
the Field TxtTpe is a label
Option Compare Database
Option Explicit
Dim HoldType As String
Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
If HoldType = [Type] Then
TxtType.Caption = [Type] & " (continued)"
Else
TxtType.Caption = [Type]
HoldType = [Type]
End If
End Sub
Phil
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
Back to comp.databases.ms-access | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
'Continued' label in Group Header when using Repeat Section - Solved CDMAPoster@fortunejames.com - 2014-08-14 06:55 -0700
Re: 'Continued' label in Group Header when using Repeat Section - Solved "Phil" <phil@stantonfamily.co.uk> - 2014-08-14 18:57 +0100
Re: 'Continued' label in Group Header when using Repeat Section - Solved CDMAPoster@fortunejames.com - 2014-08-14 15:29 -0700
Re: 'Continued' label in Group Header when using Repeat Section - Solved "Phil" <phil@stantonfamily.co.uk> - 2014-08-15 09:26 +0100
Re: 'Continued' label in Group Header when using Repeat Section - Solved CDMAPoster@fortunejames.com - 2014-08-15 06:03 -0700
csiph-web