A site for solving at least some of your technical problems...
A site for solving at least some of your technical problems...
I wrote many forms and in general everything works just fine.
In this case, I wanted to enter the data with a function so I could properly format several of the fields (especially the billing and shipping addresses.) That was done on the Load() event. That function working great when looking at the report from within MS-Access (on screen report). However, when directly sending the report to the printer, it was not working well at all.
The fact is the Load() event does not seem to be called as expected. The Open() is however. But the Open() is called before the form is loaded and thus we cannot set fields in the form from the Open() function.
Interestingly enough, I had a sub-report with a list of items. That list of items was loaded via an intermediate table and that table is linked to the form using the RecordSource member. That works great in the Open(). Since this is a sub-report, the parent (main Report) is loaded at that time. Thus, I could call my Load() function from the child.
' Parent report Function Foo_Load() ' Not called when printing! ... ' Set fields... End Function ' Child list sub-report ' Rename Foo_Load() something like FooLoadPO() Function FooChild_Open(Cancel As Integer) Report("Foo").FooLoadPO() ... End Function
The only other way would be for you to create an intermediate table, fill the data in that table, then attach that table to the report. Then the print would work.
Make sure that your item is not mark "Not for print".