Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Process All Detail on Report "On Open"

Status
Not open for further replies.

ralstat

Programmer
Jan 5, 2002
3
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top