I am using TransferSpreadSheet command in VB, to transfer a excel sheet data in to a Access table. The code is as follows,
Set oAcessApp = CreateObject("Access.Application")
Set oDoCmd = oAcessApp.DoCmd
oAcessApp.OpenCurrentDatabase AccessDatabasePath, True
oDoCmd.TransferSpreadsheet TransferType:=acImport, _
Set oAcessApp = Nothing
Set oDoCmd = Nothing
Immediately after this, I try to read the table which has been uploaded. But, the table is found to be empty. It takes some delay before data is actually inserted in the table. Thus after executing the above code, I have to put some delay loop before I can query the table uploaded. Is it that the Transferspreadsheet command runs asyncronously? and is there a wasy to avoid the delay loop? Is there a way to actually know when the TransferSpreadSheet command has finished transfering data in the table?