View Single Post
Old 09-21-2019, 06:32 AM   #8
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,253
Thanks: 15
Thanked 1,592 Times in 1,512 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
Re: What Report level fields are available to the 'On Print' event

Minty got it almost right.

In a Report, unlike a form, if you want to reference a field from the RecordSource in code, you must bind it to a control. You can make the control tiny and hidden but the field MUST be bound to a control to be available later. The reason is that Access is smarter than we are and for a report, it rewrites our query and substitutes its own version which includes ONLY the fields that are actually bound to controls. This is also why you can't rely on sort order in your RecordSource query but MUST use the Report's own sorting and grouping options to impose a sort order.
__________________
Bridge Players Still Know All the Tricks
Pat Hartman is offline   Reply With Quote
The Following 3 Users Say Thank You to Pat Hartman For This Useful Post:
Gasman (09-21-2019), GoodyGoody (09-21-2019), Minty (09-23-2019)