Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report not always 'closed' - why?

Status
Not open for further replies.

lorirobn

MIS
Mar 15, 2005
450
US
Hello,

I am working on my first Access report, after working with Access for a few months.

I created a dialog form to pass selection criteria to the report. Most of the time this works fine. However, sometimes, in the Open Report event, there are no arguments in OpenArgs. In the dialog form, they are definitely there; I step through the modules and see the values. But by the time it gets to Open Event, OpenArgs are null.

For the time being, I have to exit Access and get back in when this happens. It seems to happen after I make changes to either the report VBA module or dialog form VBA module (but not always), but I haven't pinpointed it.

Any suggestions? Anything obvious that I am not doing?
I'd say it works 95% of the time.

Also, how would I keep dialog box open and allow user to go back and forth from dialog box and report to make selection changes and view report again?

My code from the dialog form is:
Code:
Me.Visible = False
DoCmd.OpenReport strReport, View:=acViewPreview, _
        OpenArgs:=strReportArguments


Thanks!
Lori
 
You dont need the view:- and openargs:-
I assume u have already assigned and dim'ed the strings srtreport and strreportarguments...


Program Error
Programmers do it one finger at a time!
 
Hello,
Thanks for your response. Yes, I have dim'd and assigned the strings. Like I said, the processing works 95% of the time. It seems to NOT work sometimes after I make changes to the VBA module.

Why do you write that I don't need the view and openargs? I want to open it in Print Preview, and I want to pass arguments. Is that processing incorrect?

Thank you
Lori
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top