Hello, I'm having a problem with developing code to generate a report with only those records containing the value in an unbound textbox. I'm using the OnClick event on the Preview Report button on the form (I'd rather use this than create a query because I use the same report for other filters).
Here is the code I'm using:
What is wrong with my code?Code:If Not IsNull(Me.Text21.Value) Then stDocName = "rptReport" DoCmd.OpenReport stDocName, acPreview, , Chr(34) & Me.Text21 & Chr(34) & "In ([fldTitle])" End If