Here is the code
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
Dim db As Database, rst As Recordset
Dim sql As String
Set db = CurrentDb
sql = "select * from [program membershipSSA] where parorn='" & Text7.Text & "'"
Set rst = db.OpenRecordset(sql)
If IsNull(rst(1)) Then
Label0.Caption = "your SSA did not participate in any programs."
Detail.Visible = False
ReportFooter.Visible = False
Else
Detail.Visible = True
ReportFooter.Visible = True
rst.MoveLast
If rst.RecordCount > 1 Then
Label0.Caption = "your SSA participated in the following programs:"
Else
Label0.Caption = "your SSA participated in the following program:"
End If
End If
rst.Close
Set db = Nothing
End Sub
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
Dim db As Database, rst As Recordset
Dim sql As String
Set db = CurrentDb
sql = "select * from [program membershipSSA] where parorn='" & Text7.Text & "'"
Set rst = db.OpenRecordset(sql)
If IsNull(rst(1)) Then
Label0.Caption = "your SSA did not participate in any programs."
Detail.Visible = False
ReportFooter.Visible = False
Else
Detail.Visible = True
ReportFooter.Visible = True
rst.MoveLast
If rst.RecordCount > 1 Then
Label0.Caption = "your SSA participated in the following programs:"
Else
Label0.Caption = "your SSA participated in the following program:"
End If
End If
rst.Close
Set db = Nothing
End Sub