B
Bruce Rodtnick
I have a report with seven subReports, Sunday thru Saturday, that display
the information for those days. Each subReport will fill out with 8 lines
even if there is only enough data for two lines, etc.
Monday
11:00
3:00
____
____
____
____
____
____
My code to make the extra blank lines is:
Private Sub Report_NoData(Cancel As Integer)
Dim Cdb As DAO.Database
Dim rsJobs As DAO.Recordset
'Rest the row counter
bRowCounter = 0
'Get the count of the max rows that have values
Set Cdb = CurrentDb
'If IsNull(TimeID) Then
' Else
Set rsJobs = Cdb.OpenRecordset("Select Count([TimeID])as Jobs from qryNoData
WHERE StaffID = " & Reports.WeeklyTimeSheet.txtStaffID)
bJobCount = Nz(rsJobs!Jobs)
rsJobs.Close
Set rsJobs = Nothing
Set Cdb = Nothing
'Reset all controls to display in black for the first Record
Me!txtDate.ForeColor = COLOR_BLACK
Me!txtFrom.ForeColor = COLOR_BLACK
Me!txtTo.ForeColor = COLOR_BLACK
'Me!ActHoursA.ForeColor = COLOR_BLACK
'Me!TasksA.ForeColor = COLOR_BLACK
End Sub
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
bRowCounter = bRowCounter + 1
If bRowCounter < bJobCount Then
Exit Sub
Else
If bRowCounter < MAX_ROWS Then
Me.NextRecord = False
End If
End If
If (bRowCounter > bJobCount) Then
'Note the control names have been aliased with a suffix "A"
Me!txtDate.ForeColor = COLOR_WHITE
Me!txtFrom.ForeColor = COLOR_WHITE
Me!txtTo.ForeColor = COLOR_WHITE
' Me!ActHoursA.ForeColor = COLOR_WHITE
'Me!TasksA.ForeColor = COLOR_WHITE
End If
End Sub
It works great except when there is not any data for that day and then I get
nothing, but I still want 8 blank lines. I've tried:
Making an 8 record table and changing the RecordSource of the subform on
NoData.
Making a NoData subFrom and changing the SubForm on NoData.
None have worked. Any ideas of how I can put these 8 lines on a day that
has no data?
Bruce Rodtnick
the information for those days. Each subReport will fill out with 8 lines
even if there is only enough data for two lines, etc.
Monday
11:00
3:00
____
____
____
____
____
____
My code to make the extra blank lines is:
Private Sub Report_NoData(Cancel As Integer)
Dim Cdb As DAO.Database
Dim rsJobs As DAO.Recordset
'Rest the row counter
bRowCounter = 0
'Get the count of the max rows that have values
Set Cdb = CurrentDb
'If IsNull(TimeID) Then
' Else
Set rsJobs = Cdb.OpenRecordset("Select Count([TimeID])as Jobs from qryNoData
WHERE StaffID = " & Reports.WeeklyTimeSheet.txtStaffID)
bJobCount = Nz(rsJobs!Jobs)
rsJobs.Close
Set rsJobs = Nothing
Set Cdb = Nothing
'Reset all controls to display in black for the first Record
Me!txtDate.ForeColor = COLOR_BLACK
Me!txtFrom.ForeColor = COLOR_BLACK
Me!txtTo.ForeColor = COLOR_BLACK
'Me!ActHoursA.ForeColor = COLOR_BLACK
'Me!TasksA.ForeColor = COLOR_BLACK
End Sub
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
bRowCounter = bRowCounter + 1
If bRowCounter < bJobCount Then
Exit Sub
Else
If bRowCounter < MAX_ROWS Then
Me.NextRecord = False
End If
End If
If (bRowCounter > bJobCount) Then
'Note the control names have been aliased with a suffix "A"
Me!txtDate.ForeColor = COLOR_WHITE
Me!txtFrom.ForeColor = COLOR_WHITE
Me!txtTo.ForeColor = COLOR_WHITE
' Me!ActHoursA.ForeColor = COLOR_WHITE
'Me!TasksA.ForeColor = COLOR_WHITE
End If
End Sub
It works great except when there is not any data for that day and then I get
nothing, but I still want 8 blank lines. I've tried:
Making an 8 record table and changing the RecordSource of the subform on
NoData.
Making a NoData subFrom and changing the SubForm on NoData.
None have worked. Any ideas of how I can put these 8 lines on a day that
has no data?
Bruce Rodtnick