OpenArgs Problem

  • Thread starter Thread starter Don
  • Start date Start date
D

Don

Are there any tricks to using OpenArgs? I am trying to pass a simple string
to a report I am opening and always get NULL in the report (Me.OpenArgs).
The examples in Help see pretty straight forward, but I can't see where I am
messing up. Any suggestions?

Thanks!

Don




In command button OnClick code:

stDocName = "rptStaffingDocument"
DoCmd.OpenReport stDocName, acViewNormal, , , acWindowNormal, "Full"


In the reports Report_Open code
strStaffingScope = Me.OpenArgs
 
What you have should be fine provided:

- the report is not already open (in which case it recognises the OpenArgs
from when it was opened), and

- this is Access 2002 or 2003 (earlier versions did not have OpenArgs for
reports), and

- strStaffingScope is not a control on the report (because Report_Open is
too early to assign a value to a control).
 
Allen,

Looks like the problem was having the report open in design mode. Based on
your comments, I closed and restarted everything. Now works like a charm!

Thanks!

Don
 
Back
Top