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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|