Hi All,
Hopefully just something simple… I have a report which contains (and runs) the following code upon being opened:
==========================================================================================
Option Compare Database
Option Explicit
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
fldMYRECNUM = recDATABAG ! MYRECNUM
fldTWO = recDATABAG ! TWO
fldTHREE = recDATABAG ! THREE
**** THE PROBLEM IS HERE ****
‘ The report fields listed above are defined in the Detail section of my Report as unbounded text boxes with
‘ the names given. The report is supposed to list a single page header, followed by one or more lines of
‘ tabular data from the query. This only formats (and presents) the FIRST record of the query?! The other
‘ records are present, but are not formatted. Why? How do I get them to show up (as an ordinary tabular
‘ list (like when the Record Source box is filled in with the same query in Design View)?
‘ It doesn’t work to put this code in the PRINT event Procedure either.
‘
‘ Thanks for any help!!! I can usually paddle my own canoe, but you folks have been a lot of help when I get stuck!
End Sub
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
‘ this works fine
fldREPORTTITLE = “Title of Report”
End Sub
Private Sub Report_Close()
‘ this works fine
recDATABAG.Close
End Sub
Private Sub Report_Open(Cancel As Integer)
Set db = CurrentDb()
Set recDATABAG = db.OpenRecordset(“My Query”, dbOpenDynaset)
recDATABAG.MoveLast
recDATABAG.MoveFirst
‘ for proof all the records in the query were located (this works fine)
MsgBox (“Found ” & recDATABAG.RecordCount & ” records”)
End Sub
==========================================================================================