Where Condition

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
 
K

Ken Snell \(MVP\)

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.
 
B

Bill

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.
 
K

krissco

Is it necessary to use the OnOpen event? Will OnActivate work for your
App (filter is available to that event)?

-Kris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top