Access 2007 SP3 32bit
Windows 7 64bit
Dell Optiplex 790
I have a field in a report that has no control source. Instead, its value is provided via a defined global variable, gblATVsDuringTimePeriod, by the following VBA code in the report's Load event:
ATVsDuringTimePeriod.Value = gblATVsDuringTimePeriod
It works fine, and any fields based on the value also work fine... until you Print Preview the report, at which point the field and any fields calculated off of it go blank. If I just Print instead of Print Preview, everything prints fine, but if I Print Preview first, the fields are blank, even on the printed document.
I tried putting the code into the Open event, but Access didn't like that.
Is there anything that I can do to stop the fields from going blank, short of telling the users not to look at the print preview?