In red is what I am trying to add on to the code. Can anyone tell me where to add my strWhat string? Or if I even need to do this?
The strWhere that is set for the filter, carries over nicely from the split form to report. I would like to do the same with sorts. If the split form has sorts running, I would like this to carry over to the report as well. How can this be done? Ultimately, I would like the report to look exactly the same as the split form for how the records are listed. Can it be done? This code is behind the open report button on the split form.
Private Sub cmdPrintReport_Click()
On Error Resume Next
Dim strWhere As String
Dim strWhat As String
If Me.Dirty Then Me.Dirty = False
If Me.FilterOn Then strWhere = Me.Filter
If Me.OrderByOn Then strWhat = Me.OrderBy
DoCmd.OpenReport "Permit Dates Issued_report", acViewReport, , strWhere, , strWhat
Me.txtStart.SetFocus
End Sub