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!

select Title for Report

Status
Not open for further replies.

Zarcom

Programmer
May 7, 2002
1,275
CA
hey guys I am usually not an Access guy but my duties at work have shifted to include them.

I have been asked to make a change to a report. I need to make a static label into a dynamic one. I have made a query statment that uses the id of the table the report is based on to get my title. How do I now put that query into say a text box so it shows on the report?

An example of the query I have is.

select title
from table1, table2
where table1.field1 = table2.field1 and table2.field2 = ?


Thanks for any help/guidance you can give me. That'l do donkey, that'l do
[bravo] Mark
 
HI

In principle the answer to your question is:

In the OnFormat event of the relevant section (Report Header or Page Header, depending on where your label is) put code like:

MyLabel.Caption = strSQL

where MyLabel is the name of your label, and strSQL is the variable containing the sql string.

But, do you really want to display the ugly SQL string to the user, would it not be more user friendly to show a title of some form.

Regards Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
include the field that you want to extract the Title from (probably Title) in the recordsource (underlying query) of the report.
Then open the report in Design View
Go to View-Field List
Drag the Title field into the Report Header section
And that's all

Good luck
[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top