SashaBuilder3
Programmer
Hi everybody,
Another newbie problem.
I have a table in an Access db (say, Tbl1) an I need to export SORTED by date rows into a CSV spreadsheet.
What I do is the following (simplified):
1. I sort the table with transfering data into Tbl2 (to avoid circular reference).
SQL_str = "SELECT * INTO Tbl2 FROM Tbl1 ORDER BY MyDate;"
DoCmd.RunSQL (SQL_str)
2. I remove first table
SQL_str = "DROP Table Tbl1;"
DoCmd.RunSQL (SQL_str)
3. I rename the second table into the first.
DoCmd.Rename "Tbl1", acTable, "Tbl2"
4. I export the table as a CSV spreadsheet
DoCmd.TransferText acExportDelim, , "Tbl1", "Tbl1.csv", True
To my undrestanding now the table should contain the soprted by date rows. It works BUT NOT ALWAYS!
Sometimes rows are sorted, the other times not.
Please, help anyone. Any idea what's happening?
Thanks,
Alexandre
Another newbie problem.
I have a table in an Access db (say, Tbl1) an I need to export SORTED by date rows into a CSV spreadsheet.
What I do is the following (simplified):
1. I sort the table with transfering data into Tbl2 (to avoid circular reference).
SQL_str = "SELECT * INTO Tbl2 FROM Tbl1 ORDER BY MyDate;"
DoCmd.RunSQL (SQL_str)
2. I remove first table
SQL_str = "DROP Table Tbl1;"
DoCmd.RunSQL (SQL_str)
3. I rename the second table into the first.
DoCmd.Rename "Tbl1", acTable, "Tbl2"
4. I export the table as a CSV spreadsheet
DoCmd.TransferText acExportDelim, , "Tbl1", "Tbl1.csv", True
To my undrestanding now the table should contain the soprted by date rows. It works BUT NOT ALWAYS!
Sometimes rows are sorted, the other times not.
Please, help anyone. Any idea what's happening?
Thanks,
Alexandre