A
Andy
In the post "Ask for Criteria" an MVP included a link to:
Martin Green's site <http://www.fontstuff.com/access/index.htm>.
From that page there is a link to:
<http://www.fontstuff.com/access/acctut19.htm>
which includes exactly what is needed for this database.
"Automate the Report's Title
Most reports need some sort of descriptive title and you might like the
title to change to reflect the records displayed."
He gives this example:
"For each title you need to place an empty control in the report's Report
Header or Report Footer section."
"The text of your title can be made up of plain text ..."
With Reports![rptStaff]
..Filter = strFilter
..FilterOn = True
..txtReportTitle.Value = _
"Staffing Report - " & Format(Date, "dd mmm yyyy")
End With
He doesn't say where in the sequence the "With" should be placed.
Have tried, among a few dozen other combinations::
Private Sub cmdUnitsOnOrder_Click()
Dim strCriteria As String
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
strCriteria = "[UnitsOnOrder] > 0"
Msg = MsgBox("Do You want to preview the ''Items Ordered'' report
before printing?", vbYesNoCancel)
Select Case Msg
Case vbYes
DoCmd.OpenReport "rptInventory", acPreview, , strCriteria
With Reports![rptInventory]
' .Filter = strFilter
' .FilterOn = True
..txtReportTitle.Value = "Items Ordered Report - " &
Format(Date, "dd mmm yyyy")
End With
Where would the "With.Reports" be placed?
Andy
Martin Green's site <http://www.fontstuff.com/access/index.htm>.
From that page there is a link to:
<http://www.fontstuff.com/access/acctut19.htm>
which includes exactly what is needed for this database.
"Automate the Report's Title
Most reports need some sort of descriptive title and you might like the
title to change to reflect the records displayed."
He gives this example:
"For each title you need to place an empty control in the report's Report
Header or Report Footer section."
"The text of your title can be made up of plain text ..."
With Reports![rptStaff]
..Filter = strFilter
..FilterOn = True
..txtReportTitle.Value = _
"Staffing Report - " & Format(Date, "dd mmm yyyy")
End With
He doesn't say where in the sequence the "With" should be placed.
Have tried, among a few dozen other combinations::
Private Sub cmdUnitsOnOrder_Click()
Dim strCriteria As String
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
strCriteria = "[UnitsOnOrder] > 0"
Msg = MsgBox("Do You want to preview the ''Items Ordered'' report
before printing?", vbYesNoCancel)
Select Case Msg
Case vbYes
DoCmd.OpenReport "rptInventory", acPreview, , strCriteria
With Reports![rptInventory]
' .Filter = strFilter
' .FilterOn = True
..txtReportTitle.Value = "Items Ordered Report - " &
Format(Date, "dd mmm yyyy")
End With
Where would the "With.Reports" be placed?
Andy