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  

Report Shows Data from Previous Execution



 
 
Thread Tools Display Modes
  #1  
Old July 11th, 2007, 08:02 PM posted to microsoft.public.access.reports
Rob Taylor
external usenet poster
 
Posts: 1
Default Report Shows Data from Previous Execution

- I have a report that is run from an underlying query.
- The query returns records from a table based on the beginning and ending
dates entered on a form.
- The same form opens the report.
- After starting the Database and displaying the report, it works perfectly
with the date range selected (ie: 6/1/2007 to 6/30/2007)
- HOWEVER .... If the user closes the report, reenters a new date range
(ie: 5/1/2007 to 5/31/2007), and reopens the report, the report opens with
the previous data (June data)
- If the user exits the database, re-starts it, and runs with May
selections, it works fine again for the first run....
- I have verified that the underlying query returns the correct records for
the date range selected on the form.

I'm stumped.
--
Rob Taylor
Third Coast Systems
Houston, Texas
  #2  
Old July 12th, 2007, 12:36 AM posted to microsoft.public.access.reports
krissco
external usenet poster
 
Posts: 167
Default Report Shows Data from Previous Execution

On Jul 11, 11:02 am, Rob Taylor
wrote:
- I have a report that is run from an underlying query.
- The query returns records from a table based on the beginning and ending
dates entered on a form.
- The same form opens the report.
- After starting the Database and displaying the report, it works perfectly
with the date range selected (ie: 6/1/2007 to 6/30/2007)
- HOWEVER .... If the user closes the report, reenters a new date range
(ie: 5/1/2007 to 5/31/2007), and reopens the report, the report opens with
the previous data (June data)
- If the user exits the database, re-starts it, and runs with May
selections, it works fine again for the first run....
- I have verified that the underlying query returns the correct records for
the date range selected on the form.

I'm stumped.
--
Rob Taylor
Third Coast Systems
Houston, Texas


Make sure you are closing the form after opening the report. If you
did something like "Me.Visible = False" then depending on how the form
is opened, the query may execute prior to the new data being provided.

You could add something like:

on error resume next
DoCmd.Close acForm, "the form name"

To Report_Close event of your report.

-Kris


 




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 05:55 PM.


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