A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Weird Report Behavior with Access 2003 Report



 
 
Thread Tools Display Modes
  #1  
Old August 8th, 2007, 04:14 AM posted to microsoft.public.access.reports
Wesley Wildman
external usenet poster
 
Posts: 6
Default Weird Report Behavior with Access 2003 Report

Context: Windows XP SP2, Access 2003

Problem: The same report appears differently when I open it in print preview
mode from a macro versus when I open it in print preview mode from code. The
difference is that a particular control is not displayed when opening the
report from code.

The Trick: The problem only appears when I impose a Where clause. If there
is no Where clause, the report opens fine both ways. When there is a Where
clause, the control drops out, but only when the report is opened in code.
The Where clause limits dates in the underlying recordset and has nothing
directly to do with the field underlying the control that disappears. The
particular dates in the Where clause don't make any difference to the
problem. Opening the report to print rather than print preview also makes no
difference.

The code (couldn't be simpler):
Public Sub junk()
DoCmd.OpenReport "rptJunk", acViewPreview, , "DateKey1 = #10/24/2000# AND
DateKey1 = #6/30/2003#"
End Sub

Whining: How can using a Where clause in code cause this behavior? Can
someone suggest a workaround? I have already tried the obvious, including
compact & repair, starting the application using the /decompile switch, and
creating a new form and importing all of the elements into it. I have not
tried creating a brand new front-end database; there is no sign of corruption
in any other facet of the database operations.

Appeal: I am hoping someone already knows something about this weird behavior.

Thanks, Wesley Wildman
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:05 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.