L
Lori
Hi,
I have a report that has a query as its record source. I also have a
Report Menu form, where the user enters dates (in text boxes), selects
the report to be displayed, and the report is opened. The query
selects records based on these dates.
All this has worked fine. Until now, where I have a new requirement.
I need to play with one of the dates that the user enters (by
subtracting 9 days), and use the manipulated date for my report. Since
only one report needs this manipulation, I would prefer to pass the
arguments as I always have, just as the user entered them, and do the
manipulation within my report's code.
However, no matter what I do, the query seems to be picking up the data
just as it was entered on the menu form. I attempted to put text boxes
on my report, make them "visible=false", refer to these text boxes
within the query, and within my VBA, set the text box date to the
manipulated date. At this point, I got the error "You can't assign a
value to this object". I am perplexed, as the text box is unbound. I
had the code in the Report's Open event. I don't know where else I'd
put this code. Anywhere else, it would be too late, as the query would
have already selected its data. And the only place I got it to work
was in the Report Detail event (way too late).
I can always put the code back into the menu, but I really would like
to try to get it to work in the report itself (actually, I already have
gotten it to work through the menu, but it seems convoluted and also I
would like to learn how to work with the text box within the report).
Thanks in advance for any help!
Lori
I have a report that has a query as its record source. I also have a
Report Menu form, where the user enters dates (in text boxes), selects
the report to be displayed, and the report is opened. The query
selects records based on these dates.
All this has worked fine. Until now, where I have a new requirement.
I need to play with one of the dates that the user enters (by
subtracting 9 days), and use the manipulated date for my report. Since
only one report needs this manipulation, I would prefer to pass the
arguments as I always have, just as the user entered them, and do the
manipulation within my report's code.
However, no matter what I do, the query seems to be picking up the data
just as it was entered on the menu form. I attempted to put text boxes
on my report, make them "visible=false", refer to these text boxes
within the query, and within my VBA, set the text box date to the
manipulated date. At this point, I got the error "You can't assign a
value to this object". I am perplexed, as the text box is unbound. I
had the code in the Report's Open event. I don't know where else I'd
put this code. Anywhere else, it would be too late, as the query would
have already selected its data. And the only place I got it to work
was in the Report Detail event (way too late).
I can always put the code back into the menu, but I really would like
to try to get it to work in the report itself (actually, I already have
gotten it to work through the menu, but it seems convoluted and also I
would like to learn how to work with the text box within the report).
Thanks in advance for any help!
Lori