I have a report that when opened it updates the table bound to the detail records with additional information generated by the report.
The problem is that the user must click to the last page of the report to have the code executed on all detail records. So therefore, only the first page of records is correctly updated when the form is opened.
IF I COULD JUST MAKE THE REPORT DISPLAY THE LAST PAGE I THINK IT WOULD WORK... DOES ANYONE KNOW HOW TO MAKE THE REPORT DISPLAY THE LAST PAGE "ON OPEN"???
My code looks something like this:
Dim RecordCount As Integer
Dim TransmittalCount As Integer
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
RecordCount = RecordCount + 1
Me.Text118 = RecordCount
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("tblEnrolled", dbOpenDynaset)
strSearchString = "CensusID = " & Str(Text126)
With rst
.FindFirst strSearchString
.Edit
.Fields("TransmittalNumber" = TransmittalCount
.Fields("RecordNumber" = RecordCount
.Fields("EnrollerToTPADate" = Date
.Update
.Close
End With
End Sub
The problem is that the user must click to the last page of the report to have the code executed on all detail records. So therefore, only the first page of records is correctly updated when the form is opened.
IF I COULD JUST MAKE THE REPORT DISPLAY THE LAST PAGE I THINK IT WOULD WORK... DOES ANYONE KNOW HOW TO MAKE THE REPORT DISPLAY THE LAST PAGE "ON OPEN"???
My code looks something like this:
Dim RecordCount As Integer
Dim TransmittalCount As Integer
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
RecordCount = RecordCount + 1
Me.Text118 = RecordCount
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("tblEnrolled", dbOpenDynaset)
strSearchString = "CensusID = " & Str(Text126)
With rst
.FindFirst strSearchString
.Edit
.Fields("TransmittalNumber" = TransmittalCount
.Fields("RecordNumber" = RecordCount
.Fields("EnrollerToTPADate" = Date
.Update
.Close
End With
End Sub