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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combo box to give title to report 1

Status
Not open for further replies.

honeypot3

Instructor
Feb 8, 2005
77
GB
I have a report based on a query that gets its selection criteria from an unbound combo box on a form. So the user can select the name of a project rather than having to know its ID, the combo box is set up to be bound to the ID field (so the query selection works right) but to display the name of the project. This works fine for the report at the moment but I need to add a title to the report that reflects which project (by its name) is being reported on. Is there any way I can get the report to reference the name of the project from the combo box rather than its bound column which it is doing at the moment when I use a text box to reference the form control in question.

Thanks

 
Just place textbox on the report and format it's size/font/color etc.
then
ControlSource =Forms!YourformName!ComboBoxName

Your form must be open to get the value on the report.

________________________________________
Zameer Abdulla
Visit Me
There is only one perfect child in this world. Every mother has it.
 
thanks Zameer but originally tried that and got the bound column instead of word in combo box. So added name of missing field to underlying query, pulled the name into the subreport, made it invisible and then referenced the report control in the title. But thanks anyway.
 
You could add a textbox on the form and use the code like below
Private Sub ComboBox1_AfterUpdate()
Me.TextBox1.Value = Me.ComboBox1.Column(0)
End Sub
Then refer this text box to report.

Me.ComboBox1.Column(1) will be the second column.


________________________________________
Zameer Abdulla
Visit Me
A child may not be able to lift too much. But it can certainly hold a marriage together
 
Thanks Zameer - that is a much more slick solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top