Report Parameters

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??
 
B

Brendan Reynolds

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top