Display variable in report header

mrkipling

Registered User.
Local time
Today, 21:24
Joined
Mar 19, 2003
Messages
22
Can anyone tell me how i would display a variable from my vba code, to a text box in my report header, I assume that i will have to make the variable global, but where do i go from there.

TIA

mark
 
The record source for the report variable should be a text box on an underlying form.
 
Hey Mark,

In the PageHeaderSection (Format), put:
txtYourTextBoxName = yourStringVariable

It's as simple as that! - and the variable does not need to be (and should not be) global.

-Sean
 
I see what llkhoutx's saying too - it depends on what you mean by "variable" or by when you determine its value. If you've already suceeded in determining the value within your VBA, then use the solution I posted - if you have not yet determined it, then use llkhoutx's.

Just to be sure - if you are looking to have sub headings, then have a look at the sorting and grouping button on your toolbar.

-Sean
 
Thanks a lot for the help guys. llkhoutx's solution is relevant to what i want but i dont understand how i would set the record source to be a text box on an underlying form ?
 
Merely store the sql string for the record source in a text box.

However, if you are referencing the sql string as the record source for a report, build a query with sql at execution time with VBA and then use that query as the recordsource for your report.
 

Users who are viewing this thread

Back
Top Bottom