Hi, I have a relatively slow machine and it seems to be affecting the way I import an excel file data to a temp table, while immediately looking into that temp table afterwards.
where rst is opening tmpStudentImport
The problem is, the code done in the while loop stops prematurely (does not go through the whole tmpStudentImport table) 'sometimes'. When I open the form too quickly and run the import, it stops prematurely with no errors (I checked and it indeed does go to EOF). If I open the form and wait for everything to finish loading, and then do the import, it imports everything fine.
My question is, is there a way to check, via code, that the export has been completed?, before starting the while loop? I was thinking on adding a dummy loop between it so it will do the loop (for no good reason) only to stop it from reading quickly.
Suggestions? Thanks in advance!
Code:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "tmpStudentImport", "C:\StudentImport.xls", True
Do While Not rst.EOF
. . .
. . .
The problem is, the code done in the while loop stops prematurely (does not go through the whole tmpStudentImport table) 'sometimes'. When I open the form too quickly and run the import, it stops prematurely with no errors (I checked and it indeed does go to EOF). If I open the form and wait for everything to finish loading, and then do the import, it imports everything fine.
My question is, is there a way to check, via code, that the export has been completed?, before starting the while loop? I was thinking on adding a dummy loop between it so it will do the loop (for no good reason) only to stop it from reading quickly.
Suggestions? Thanks in advance!