OpenReport & OpenArgs

  • Thread starter Thread starter Dennis
  • Start date Start date
D

Dennis

All,

OS XP Pro SP3
Access: XP Office Pro SP3

Neither the filter parameter is working nor is the OpenArgs being passed. I
read an article in this discussion group from a 2/23/2005 where Ken Snell
discussed this issue. I followed his instructions and suggestions and it
still does not work.

I am trying to make the Filter and OpenArgs work in an OpenReport statement.

The code in my Menu form command button click event:

Dim strDocName as String
Dim strOpenArgs As String
Dim strFilter As String

strDocName = "rptOtherMem"
strFilter = "[MemType] = 'O'"
strOpenArgs = "Other"

DoCmd.OpenReport strDocName, acViewPreview, strFilter, , acWindowNormal,
OpenArgs:=strOpenArgs

(I also tried:)

DoCmd.OpenReport strDocName, acViewPreview, strFilter, , acWindowNormal,
strOpenArgs

--------------------------------------------------

Code in the Open Event in rptOtherMem

Private Sub Report_Open(Cancel As Integer)

Dim strOpenParms As String

strOpenParms = Nz(Me.OpenArgs, "") ' Process the Opening
Arguments

I am running the process in debugger a line at a time. The value of
OpenArgs is null.

Any suggestions? Thank you for your assitance.
 
Is the report already open? Even in design view?
If so, it already has its OpenArgs, so the new one won't get there.

I've not had much success with the Filter argument in recent versions of
Access. The WhereCondtion works. Or you can set its Filter in Report_Open
(and set FilterOn to True,)
 
Allen,

The report was opened in design view. I closed it and it works.

I tried both the Where parm and the me.report.filter in the report and both
worked great!
 
Back
Top