G
Guest
I have written a module in Access 2000 with DAO 3.6 referenced, that creates a Table, then runs a loop that the user inputs a number of months that depreciation will be applied, and a starting Transaction Date.
This loop writes a SQL statement to populate the table with two fields: a Transaction Number, and a Transaction Date: strSQL = "INSERT INTO Ass2Depcn ( [TA#], TADate )SELECT " & strTA & " AS [TA#], " & Format(datTADate, "Short Date") & " AS TADate;
With each loop I have used the stored procedure DateAdd to increase the next statement by one month:
datTADate = DateAdd("m", 1, datTADate
When I run this in the immediate window I get the correct result (NB I am an Aussie), ie
1 31/12/200
2 30/1/200
3 28/2/200
But when I run the module into the table I get the date field decreasing in value starting at 1/1/1900 and by seconds at a time. Even though the table is formatted to display in Short Date, it displays time values
Hope you can help, thanks in advance
This loop writes a SQL statement to populate the table with two fields: a Transaction Number, and a Transaction Date: strSQL = "INSERT INTO Ass2Depcn ( [TA#], TADate )SELECT " & strTA & " AS [TA#], " & Format(datTADate, "Short Date") & " AS TADate;
With each loop I have used the stored procedure DateAdd to increase the next statement by one month:
datTADate = DateAdd("m", 1, datTADate
When I run this in the immediate window I get the correct result (NB I am an Aussie), ie
1 31/12/200
2 30/1/200
3 28/2/200
But when I run the module into the table I get the date field decreasing in value starting at 1/1/1900 and by seconds at a time. Even though the table is formatted to display in Short Date, it displays time values
Hope you can help, thanks in advance