How to update ListBox.RowSource property when printing

T

ThomasAJ

In a detail section I have a listbox whose rowsource needs to be updated by a
query string in the OnFormat event. The query selects records based on the
value of a product (the product is printed in the detail section). However I
get a message saying the rowsource cannot be updated when a report is opened
in preview mode or has started printing.

So how does a query dependant listbox work in a report?
 
K

Ken Snell \(MVP\)

Why use a listbox in a report? Use a subreport instead, and set the
recordsource of the subreport to the desired query from the main report's
programming.
 
Top