Is it possible to "deactivate" a report control?

RedSkies

Registered User.
Local time
Today, 13:54
Joined
Aug 17, 2000
Messages
48
In a nutshell (a large nutshell!), I have a complex Budget vs. Actual expense report made up of multiple subreports - 36 in all - one for each calendar month for Budgeted, Actual Labor and Actual Other expenses. Underlying queries for subreports are all built on the fly based on user input. I have two master reports which use the same set of subreports. One is grouped by resource name, the other by project name.

What I'm trying to avoid is having 72 subreports (36 for for the report by Resources and another 36 for the Project report).

Since I'm trying to run each subreport based on the type of report desired by the user, the Record source query will be different depending on report type. Although the subreport contains the same controls regardless of the record source. In the case of the Project subreport, the query has no "Resource ID" element, even though a "Resource ID" control appears on the subreport.

So, is there any way to deactivate the control named Resource ID on the Report Open event or something, so the report isn't looking for a control source that doesn't exist in the query?

Or better yet, is there another way to approach this?

Thanks!
 
In the code module you can add code that says in the case of the Project subreport make the Resource ID control not visible (ResourceID.Visible = False) else make it visible (ResourceID.Visible = True)
 
Thanks for your reply. Unfortunately using the Visible property doesn't work either. Even if a control is invisible, if it's bound, it will still look for a control source.

Actually I figured out a workaround. Since my underlying queries are all built programmatically at runtime, I simply added a column in the "Non-Resource related query containing the expression "Resource ID: 0"

This way the control can find its control source, but the data in the field won't affect the the way I want the report to generate. It seems to work so far, even it it's not the most elegant solution in the world!

Thanks again.
 

Users who are viewing this thread

Back
Top Bottom