I had to finally give up on the code..... Trying to follow the execution when the data source is missing 35 fields..... well, I went quietly insane
While there is nothing wrong with using Access to sort an Excel spreadsheet, it is unusual.
I have used Access to read and write text/CSV files without putting any data into a table. At one point I was using Access to import data from an Excel spreadsheet, normalize the data, then after adding more data, write the normalized data back to Excel, effectively in un-normalized form.
Originally Posted by
thape
I didn't decide to use Access. It was given as task using Access. Try to write a program for the scheduling department.
I will try to normalize my data.
You can run the same code (converted for Excel) in Excel. Just curious, is there a reason for using Access??
I have noticed a few errors. For instance, you have
Code:
rs1.Move (rs1Position)
"rs1Position" is declared as an Integer. But the MOVE argument should be a Long Integer.
Something else that *might* cause problems is this line:
Code:
rs3.FindFirst "[ODmm] =" & od1
You declared "od1" as a string (Dim od1 As String), but are missing the text delimiters.
Code:
rs3.FindFirst "[ODmm] ='" & od1 & "'"
Originally Posted by
thape
I will try to normalize my data.
Normalizing the data will only have an effect if you import the Excel data into Access, then do what is required (sort/ print/ etc).
From your first post:
Originally Posted by
thape
The problem I have: 1. Sometime , the function run into error at rs1.edit sometimes not????????
2. Any suggestion on this Bubble Sort idea..or some other way to achieve the task??????
3. Sometimes my code works, sometime not ??????
Without having the full dataset (Excel sheet), cannot make any recommendations to solve problems 1, 2 or 3.