rjmccorkle
Programmer
I am using VB6 to control an Access97 database. I wrote a report in Access that is based on a query. The report is in a temporary database since part of the process is filling a table with current info, printing the report, then deleting all the rows and compacting the database. I don't want to take a chance messing up the original database with all the file manipulations.
Part of the query is based on a table in the original database (the names & addresses) and part in the imported records in the temporary database. The imported records include 2 date fields, a starting and an ending date. All records have a starting date, not all have an ending date. The purpose of the report is to calculate the number of days each record has in a user supplied date range. If there is no ending date in the record, it is assumed that the date range ending date is used.
First I import the records that meet the date criteria to the temporary database then I do an update on the temporary table: it contains 2 imported date fields,Starting and Ending, and 2 empty date fields, FirstDay and LastDay. The update routine fills in FirstDay with Starting if Starting is >= dateRangeStart, otherwise it uses the dateRangeStart, and in similar fashion fills the LastDay based on the Ending date in the record and the dateRangeEnding date.
In the report I show the Start date, Ending date,FirstDay and LastDay and days calculated by subtracting Firstday from LastDay.
When the user is done viewing the report, the records in the temporary database get deleted and that database gets compacted.
Here is the problem: I run it once and it prints fine. I run it again and all the records appear; but the records with Ending dates do not display the FirstDay and LastDay fields and the number of days field is blank(its formula is (Lastday-Firstday)+1. If I do any changes to the report, then run the VB program again, it prints OK the first time but not subsequent times.
ANY help would be GREATLY appreciated.
Bob
104122.315@compuserve.com [sig][/sig]
Part of the query is based on a table in the original database (the names & addresses) and part in the imported records in the temporary database. The imported records include 2 date fields, a starting and an ending date. All records have a starting date, not all have an ending date. The purpose of the report is to calculate the number of days each record has in a user supplied date range. If there is no ending date in the record, it is assumed that the date range ending date is used.
First I import the records that meet the date criteria to the temporary database then I do an update on the temporary table: it contains 2 imported date fields,Starting and Ending, and 2 empty date fields, FirstDay and LastDay. The update routine fills in FirstDay with Starting if Starting is >= dateRangeStart, otherwise it uses the dateRangeStart, and in similar fashion fills the LastDay based on the Ending date in the record and the dateRangeEnding date.
In the report I show the Start date, Ending date,FirstDay and LastDay and days calculated by subtracting Firstday from LastDay.
When the user is done viewing the report, the records in the temporary database get deleted and that database gets compacted.
Here is the problem: I run it once and it prints fine. I run it again and all the records appear; but the records with Ending dates do not display the FirstDay and LastDay fields and the number of days field is blank(its formula is (Lastday-Firstday)+1. If I do any changes to the report, then run the VB program again, it prints OK the first time but not subsequent times.
ANY help would be GREATLY appreciated.
Bob
104122.315@compuserve.com [sig][/sig]