S
Steve Perrins
I have a report which contains a listbox that I need to fill with data
collected from VBA code. The report is based on a form that does the same
thing. I have set an OnOpen event within the report to fire off the code.
Code snippet:-
Me.List0.AddItem "Development Name;No. Units;Completed;Exchanged;Value
Of Exchange;Under Offer;Available;Est Comp;Contract Out"
When I run the report I get the following error message :-
Run-time error 2191
You can't set the Row Source property in print preview or after printing has
started.
I can understand the reason for this as the system needs to know what has to
be printed/previewed before the report is displayed, but, according to the
help the Open Event for reports occurs before a report is previewed or
printed.
I have also tried setting the reports listbox from within a form event and
then opening the report with the do command but you can't access the reports
controls before it is opened.
Any suggestions on how to dynamicaly build a listbox in a report from VBA
code would be greatly appreciated.
Thanks,
Steve Perrins.
collected from VBA code. The report is based on a form that does the same
thing. I have set an OnOpen event within the report to fire off the code.
Code snippet:-
Me.List0.AddItem "Development Name;No. Units;Completed;Exchanged;Value
Of Exchange;Under Offer;Available;Est Comp;Contract Out"
When I run the report I get the following error message :-
Run-time error 2191
You can't set the Row Source property in print preview or after printing has
started.
I can understand the reason for this as the system needs to know what has to
be printed/previewed before the report is displayed, but, according to the
help the Open Event for reports occurs before a report is previewed or
printed.
I have also tried setting the reports listbox from within a form event and
then opening the report with the do command but you can't access the reports
controls before it is opened.
Any suggestions on how to dynamicaly build a listbox in a report from VBA
code would be greatly appreciated.
Thanks,
Steve Perrins.