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

Unbound Control in Page Header

Status
Not open for further replies.

Murphette

Technical User
Jun 17, 2005
10
US
I have an unbound control in a report page header whose control source is a DCount function. It works perfectly well, giving me the correct calculation...except it never displays it on the first page. The correct calculation is on page two and all subsequent pages. I could almost live with this, but unfortunately some reports are only going to be one page, with no data. What am I doing wrong?

 
Do you mean the PageHeader doesn't show on the first page even if the dcount function isn't there?

Is the dcount function referencing something in the recordset? Or totally unrelated tables/queries?

And there is no code in the PageHeader that doesn't show it?

What about if you put the calculation in the ReportHeader?

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
All the other controls in the report page header are visible on all pages of the report, including the label of my troublesome unbound control.
The report opens via a macro with two actions: 1) open the report (and filter records in the where statement) 2)set value of the unbound control named "pooltotal" to a calculated function DCount("StaffID","Q-6888-Pool","DivDescription = 'ASD'").
The data for the report is coming from a query (Q-6888-Nulls) which also uses Q-6888-Pool and another query.
I don't see any code in the page header that is preventing the control from displaying on page one. When I moved the control to the report header, the label is visible, the control is blank.
 
I even created a new unrelated query to serve as the domain of the DCount function...and it still won't show on page one. The mystery deepens....
 
It's not that the control isn't visible, sounds like the issue is that there is no value put into it. To test this, make the border of the control black.

Also make a query that is a duplicate of your dcount function (Table/Query = "Q-6888-Pool", Totals query, Count StaffID, Criteria Description = "ASD") and run it. Does it return any records? What is the sql of query Q-6888-Nulls? what is the sql of query Q-6888-Pool? Obviously these are not pulling any data. I'm thinking that these queries are based on something in the report that isn't calculated yet/before it is opened?

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Mystery solved...
The SetValue action was carried out after the report opened and that's too late for the values for the controls to appear on the first page. I appreciate your time Ginger, your posting got me thinking about sequence of actions, and Bingo! Thank You!
 
 http://support.microsoft.com/kb/162537
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top