R
Roland
I have the following Event Procedures in a report that prints invoices for 14
households, up until now only Household1 has required their departments
split. Household7 has now asked for their invoices to be split by department.
Thanks to help elsewhere (see Nesting IIF's), I think I have the report side
sorted, but need to update the following procedures as well
**Procedure1**
Private Sub DeptFooter_Format(Cancel As Integer, FormatCount As Integer)
On Error GoTo Error_DeptFooter_Format
If Me![txtHHNo] = 1 Then
Reports![rptInvoice].DeptFooter.ForceNewPage = 2
Reports![rptInvoice].DeptFooter.Visible = True
Else
Reports![rptInvoice].DeptFooter.ForceNewPage = 0
Reports![rptInvoice].DeptFooter.Visible = False
End If
Exit_DeptFooter_Format:
Exit Sub
Error_DeptFooter_Format:
MsgBox Error(Err)
Resume Exit_DeptFooter_Format
End Sub
**Procedure2**
Private Sub DeptHeader_Format(Cancel As Integer, FormatCount As Integer)
On Error GoTo Error_DeptHeader_Format
If Me![txtHHNo] = 1 Then
Reports![rptInvoice].DeptHeader.Visible = True
Else
Reports![rptInvoice].DeptHeader.Visible = False
End If
Exit_DeptHeader_Format:
Exit Sub
Error_DeptHeader_Format:
MsgBox Error(Err)
Resume Exit_DeptHeader_Format
End Sub
I know I need to adjust the lines
If Me![txtHHNo] = 1 Then
to show 1 & 7, but how?
NB I am not the originator of the db, but am now the only one who has
limited Access knowledge and this is a bit beyond what I know/can work out
households, up until now only Household1 has required their departments
split. Household7 has now asked for their invoices to be split by department.
Thanks to help elsewhere (see Nesting IIF's), I think I have the report side
sorted, but need to update the following procedures as well
**Procedure1**
Private Sub DeptFooter_Format(Cancel As Integer, FormatCount As Integer)
On Error GoTo Error_DeptFooter_Format
If Me![txtHHNo] = 1 Then
Reports![rptInvoice].DeptFooter.ForceNewPage = 2
Reports![rptInvoice].DeptFooter.Visible = True
Else
Reports![rptInvoice].DeptFooter.ForceNewPage = 0
Reports![rptInvoice].DeptFooter.Visible = False
End If
Exit_DeptFooter_Format:
Exit Sub
Error_DeptFooter_Format:
MsgBox Error(Err)
Resume Exit_DeptFooter_Format
End Sub
**Procedure2**
Private Sub DeptHeader_Format(Cancel As Integer, FormatCount As Integer)
On Error GoTo Error_DeptHeader_Format
If Me![txtHHNo] = 1 Then
Reports![rptInvoice].DeptHeader.Visible = True
Else
Reports![rptInvoice].DeptHeader.Visible = False
End If
Exit_DeptHeader_Format:
Exit Sub
Error_DeptHeader_Format:
MsgBox Error(Err)
Resume Exit_DeptHeader_Format
End Sub
I know I need to adjust the lines
If Me![txtHHNo] = 1 Then
to show 1 & 7, but how?
NB I am not the originator of the db, but am now the only one who has
limited Access knowledge and this is a bit beyond what I know/can work out