Thanks for the reply,
I thought I had mentioned the version in the first post. Sorry. I am using
Access 2000 which I do not beleive has the OpenArgs Method for reports.
Thanks again.
I use Access 2002, and I don't remember if Access 2000 has it or not.
You can check rather easily.
Open any code window and type OpenReport (don't space after the "T")
Press the F1 key and the Help window will open on the OpenReport
method.
Look at the available arguments.
It will be the last argument listed.
expression.OpenReport(ReportName, View, FilterName, WhereCondition,
WindowMode, OpenArgs)
If you don't have it, then you can use something like this.
Note: Do NOT close the calling form (FormA or FormB) when running the
report.
Code the Report's Report Header Format event:
If CurrentProject.AllForms("FormA").IsLoaded Then
Me!LabelName.Visible = false
ElseIf CurrentProject.AllForms("FormB").IsLoaded Then
Me!OtherLabel.Visible = false
Else
Me!ThirdLable.Visible = false
End If
Close the form (You can close a form without error, even if it's not
open) in the Report's Close event:
DoCmd.close acForm, "FormA"
DoCmd.close acForm, "FormB"
DoCmd.close acForm, "FormC"
etc.