Where Condition

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

In the OnOpen event of a report, I'd like to
obtain the "condition" specified in the
DoCmd.OpenReport when the report
invocation was issued. I would have thought
that a reference to Me.Filter would reveal
the condition expression used, but at open
time that is empty (Msgbox Me.Filter prints
blank)

I'd like the code to be down level compatible
with A2K, so I can't use OpenArgs to pass
the expression there.

Thanks,
Bill
 
I don't know of a way to do this the way you want. What I often do is write
the Where string to an invisible textbox on the form (do this just prior to
the DoCmd.OpenReport action) that is opening the report, and let the report
read the string from that invisible textbox -- and you can use the Report's
Open event to do this.
 
Got it Ken, thanks.
Bill

Ken Snell (MVP) said:
I don't know of a way to do this the way you want. What I often do is write
the Where string to an invisible textbox on the form (do this just prior to
the DoCmd.OpenReport action) that is opening the report, and let the report
read the string from that invisible textbox -- and you can use the Report's
Open event to do this.
 
Is it necessary to use the OnOpen event? Will OnActivate work for your
App (filter is available to that event)?

-Kris
 
Back
Top