Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Report title according to form data

Status
Not open for further replies.

Jahappz

Technical User
Jun 3, 2002
133
SE
Hello!

I have a report that i want to have the "title" to be
according to a field in a form that i have.



eg. enter "TEST" in the form and the "title - caption" should be "TEST" in the report.

is this possible?
 
You can set the title in the form's open event:

Code:
Private Sub Report_Open(Cancel As Integer)
Me.lblTitle.Caption = Forms!frmF!txtName
End Sub

Or you can use a textbox and refer to the form in the Control Source:

= Forms!frmF!txtName
 
Ms VB complains about the ".lblTitle"

when running the report any idéas?
 
Yes, change lblTitle and the name of the form to the names that you have used.
 
Private Sub Report_Open(Cancel As Integer)
Me.Caption = Forms!frmF!txtName
End Sub

Worked for me!

Big thanks! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top