quote: I want the text object in page header to show 'Main' on every page of main report or show 'Subreport' when the page footer 1a comes out (since the subreport is inserted in this section).
I'm not sure if you mean, 'show subreport' when the user drills down, or if your subreport prints on a new page. It sounds like you want some sort of switch where either the main is on, and the sub is off, or vice-versa.
If you want to show or hide a text object, one way to achieve that is to use the suppress option of the object(s) in question. To do that you right-click on the object and choose Format; now you click the formula button next to the Suppress tick box and in the code window you would write something like this:
// suppress the main report page header object if the subreport is showing.
// note: this code is to be inserted into the text object in the main report
// page header.
if isnull([subreportname].[field]) // there are no values to return in the field
// so the subreport must be blank
then true // suppress this object
else false // don't suppress this object
Hopefully you can use this sort of logic to solve your problem but like I say, I'm not quite clear on your objectives.