OpenArgs Problem

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
 
A

Allen Browne

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).
 
D

Don

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
 

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