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

Data from form at top of Datareport?? 1

Status
Not open for further replies.

Toby1kenobe

Instructor
May 26, 2002
66
GB
Hi all

In access i've made reports that have an unbound text box at the top, set to a value from a combo box on the form that triggered the report. The user selected a name from the combo then previewd the report.The report has that name at the top. eg

txtName = forms!frmReport_Menu.combo1

Can this be done on VB 6 Datareports?

Thanks
Toby
 
This can be done using something like...

Code:
DataReport.Sections("ReportHeader").Controls("lblFillMeIn").Caption = "Filled In"

Of course, you'd need to change the section and control names accordingly.

--
Jonathan
 
thanks Jonathon

Could i swap ......caption = "Filled in"

for

.................caption = forms!frm_Report_menu.combo1

??

Thanks again
toby
 
You can set the label's caption equal to a control's value, yes.

--
Jonathan
 
Thanks again Jonathon

I might be mising something really obvious because the Datareport object is not recognised. Is there a reference i need to install?

Thanks
Toby
 

Toby1kenobe

I notice that you haven't yet had any successful questions! You've asked 34, and extended your question a few times, but you haven't marked any as helpful or valuable.

If the answers haven't been any good, then please read the whole of faq222-2244 to see how to get better answers. If the answers have helped then please read faq222-2244 to see how to acknowledge the help given!

For this question you should get all required datareport references when you add the DataReport to your project:

Project Menu|Add DataReport

Make sure your code uses the same name as the DataReport's name.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
I should have mentioned... replace
Code:
DataReport
in the above code with the name of your DataReport.

It's just like any other object or control...
Code:
objName.xxx
.

--
Jonathan
 
Dear Johnwm

You are very true. In future i will endeavor to mark posts as useful. The tips i have been given have helped me enormously over the last year, and have always been prompt.

Thanks for pointing this out to me

Toby
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top