Report Parameters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report in Access2003 which is not bound to any tbl or qry. It has a
report front page, then lots of sub reports in it. I have recently removed a
label that said Finacial Report and i wanted the user to be prompted for a
report title. so i create a text box and used [Enter Report Title] as the
control source. When you view the report in preview it comes up with an
#NAME? and doesnt create a prompted for users to enter a title.

I can only think this is because my report doesnt have a record source. do i
need to create a blank qry to link the report to in order to get the
prompting to work??
 
You could do it with a little code in the Open event procedure ...

Private Sub Report_Open(Cancel As Integer)

Dim strTitle As String
strTitle = InputBox("Please enter the report title")

'a single quote follwed by a double quote after the "=" sign, and a
single quote between two double quotes at the end
Me.Text0.ControlSource = "='" & strTitle & "'"

'alternatively, you could use a label
Me.Label1.Caption = strTitle

End Sub
 
Back
Top