S
scadav
Hi,
I am allowing a user to chose multiple criteria from a form in order to
create a custom report. Once they have chosen all the criteria I build
a SQL statement and put that statement in the record source of the
report, then generate a print preview of the report report for them to
view. I do this in the following manner:
DoCmd.OpenReport ("SearchResults"), acViewDesign
Reports![SearchResults].Report.RecordSource = sSQLCommand
DoCmd.OpenReport ("SearchResults"), acViewPreview
DoCmd.Save acReport, "SearchResults"
My problem arises from the last line "DoCmd.Save acReport,
"SearchResults"". I put this in place because it kept prompting me to
save changes when I closed the print preview of the report and I didn't
want the users to see this pop-up. This line works fine as long as no
one else is in the database. Once I put this into production (in a
multi-user environment), that line item causes a run-time error saying
that it can't obtain exclusive rights.....
Since these reports are dynamic, I don't really care if they get saved,
so does anyone know how to prevent the save change pop-up from coming
up or how to automatically lose the changes on close?
Thanks for you help.
I am allowing a user to chose multiple criteria from a form in order to
create a custom report. Once they have chosen all the criteria I build
a SQL statement and put that statement in the record source of the
report, then generate a print preview of the report report for them to
view. I do this in the following manner:
DoCmd.OpenReport ("SearchResults"), acViewDesign
Reports![SearchResults].Report.RecordSource = sSQLCommand
DoCmd.OpenReport ("SearchResults"), acViewPreview
DoCmd.Save acReport, "SearchResults"
My problem arises from the last line "DoCmd.Save acReport,
"SearchResults"". I put this in place because it kept prompting me to
save changes when I closed the print preview of the report and I didn't
want the users to see this pop-up. This line works fine as long as no
one else is in the database. Once I put this into production (in a
multi-user environment), that line item causes a run-time error saying
that it can't obtain exclusive rights.....
Since these reports are dynamic, I don't really care if they get saved,
so does anyone know how to prevent the save change pop-up from coming
up or how to automatically lose the changes on close?
Thanks for you help.