Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Import Do While

Status
Not open for further replies.

crimsntyd

Programmer
Sep 27, 2005
55
US
Hi,
I have a VB app that imports an excel spreadsheet into a temporary table in Access (2002 SP3), then queries that table (created at runtime) against another existing table, does some edits, then deletes the temporary table. My problem is that the query (which creates a recordset with an sql statement in DAO), starts before the temporary table is created/finished being created, and I get a run-time error. If I hit "Debug" a couple of times and restart a couple of times, it continues. How do I tell the app to DoEvents or something like that until the temp. table is created?

I'm using VB6 on a Win2000 PC.
 
I suppose you could add a delay on the lines of:
[tt]Delay = DateAdd("s", 10, Now()) 'Wait 10 seconds
Do Until Delay = Now()
Loop[/tt]
Not very satisfactory, though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top