Office 2010 SP1 Broke My App

K

kagard

Greetings:

My report generating code worked yesterday. (It automatically generated 73 reports correctly.) Today, instead of each recipient getting just their information, every report contained everyone's data. The reports still run, but the Where clause isn't being applied. Here's the line of code:

DoCmd.OpenReport ReportName, acViewPreview, , TheWhereClause, acWindowNormal, LevelOfDetail

When I view this in break mode, the ReportName is correct and TheWhereClause contains the right criteria
( [Salesman] = "John Smith" ) for example. Executing this line of code opens the report, but TheWhereClause is not applied and all records are displayed.

I copied the UI (front end) to my boss' computer, which did not have SP1 applied, and everything works fine.

Quarter End reports have to go out tomorrow morning, so this couldn't have happened at a worse time. Does anyone know what is causing this, and what Ican do to work around it?

TIA
Keith
 
A

Arvin Meyer

Try building a query. Add the criteria in the Salesman column manually for
the where clause. If that works, right-click and chose Build in the criteria
box in the Salesman column. Then add the form reference for the where
clause.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://access.mvps.org
Co-author: "Access Solutions", published by Wiley


Greetings:

My report generating code worked yesterday. (It automatically generated 73
reports correctly.) Today, instead of each recipient getting just their
information, every report contained everyone's data. The reports still run,
but the Where clause isn't being applied. Here's the line of code:

DoCmd.OpenReport ReportName, acViewPreview, , TheWhereClause,
acWindowNormal, LevelOfDetail

When I view this in break mode, the ReportName is correct and TheWhereClause
contains the right criteria
( [Salesman] = "John Smith" ) for example. Executing this line of code opens
the report, but TheWhereClause is not applied and all records are displayed.

I copied the UI (front end) to my boss' computer, which did not have SP1
applied, and everything works fine.

Quarter End reports have to go out tomorrow morning, so this couldn't have
happened at a worse time. Does anyone know what is causing this, and what I
can do to work around it?

TIA
Keith
 
K

kagard

Thanks for the reply, Arvin.

As it turns out, adding this to each report open event procedure:

Dim WhereClause As String
WhereClause = Me.Filter

and this to the end of each report open event procedure:

Me.Filter = WhereClause

makes it work.

I'm not resetting the filter in the body of the procedure, but
something I am setting must, under SP1, cause the Where clause to be
lost or reset.
 

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