View Full Version : Changing groupheaders dynamically w/VBA


Timtropolis
05-08-2007, 08:11 AM
Greetings all,

I have a report in which I need to change the groupheaders from section to section depending on what the value is on the top header.

i.e. - Groupheader0 = 1.

Groupheader1 = AA

Groupheader0 = 2

Groupheader = BB

Can this be done mid report? or does access only allow groupheaders to be set prior to report run?

thanks,
Tim

shudini
05-08-2007, 09:11 AM
i don't fully understand your question, but each of the Header sections have OnFormat events that allow you to put in any kind of conditional formatting.

rainman89
05-08-2007, 09:23 AM
Can this be done mid report? or does access only allow groupheaders to be set prior to report run?

needs to be done prior!

shudini
05-08-2007, 10:06 AM
the OnFormat event occurs when Access begins the formatting of that header - ie. when the report is being drawn up. You need to program the onFormat event prior to running the report, but the conditions will apply on the fly.