Report Showing Data from previous run....??!!

GUIDO22

Registered User.
Local time
Today, 17:12
Joined
Nov 2, 2003
Messages
515
I have a REPORT containing 7 ('columnar') subreports.
Each subreport is to show showing a days worth of medical doses.... to visually represent a wall planner.

When the report loads - user enters a week value # via Inputbox().
This value is written to a TEMP table.
Each subreport accesses this same TEMP table to retrieve the week # value. In the Recordsource for each subreport I have the following code :

SELECT * FROM GETPATIENTREADINGS_WEEK WHERE (((Format([DateR],'ww'))=DLookup("WeekVal","[TEMPTABLE]")) AND ((GETPATIENTREADINGS_WEEK.DayVal)=1));

... where the DayVal goes from 1...7 corresponding to the columnar position of each subreport on the display ie. for each day of the week.

The problem I am having is that when the report runs - I see the display showing the data from when the report was previously run. ie. I have to run the report twice to see the data for the correct week value entered. All the SQL works as expected when I run from Query view but when I run through VBA....I get the problem...

Anyone any ideas to get me out of this rut would be appreciated.
(I am using 2003 by the way).

Thank you,
 
are you sure this is happening before you run the report for the first time

Code:
 This value is written to a TEMP table.
 
are you sure this is happening before you run the report for the first time

Code:
 This value is written to a TEMP table.

Yes, because if I change the week value - the table is updated with this new value but the display shows that from the previous run....
 
You say you are running thru VBA, please post that code cause it sounds like that might be where the problem is.
 

Users who are viewing this thread

Back
Top Bottom