importing

  • Thread starter Thread starter Justin Donaldson
  • Start date Start date
J

Justin Donaldson

I have an import function that links a table in another
database into the current one. It names this
table "ImportOriginal".

At the beginning of the function, the program searches
for this table, and if it exists, it deletes it. Next,
it will try and link the database file once again to a
linked table called "ImportOrginal" using the
docmd.transferdatabase command.

However, it will routinely end up naming the
table "ImportOriginal1". If I step through the
procedure, this error will not occur. I have added
currentdb().tabledefs.refresh and dbengine.idle
(dbrefresh) before each statement. However, the error
still occurs in normal runtime.

Is there another command I can call to ensure that the
table is named properly? Or, is there a better way to do
this.

thanks,

Justin
 
Hi Justin,

I always stick in calls to DoEvents() when this sort of thing happens.

I have an import function that links a table in another
database into the current one. It names this
table "ImportOriginal".

At the beginning of the function, the program searches
for this table, and if it exists, it deletes it. Next,
it will try and link the database file once again to a
linked table called "ImportOrginal" using the
docmd.transferdatabase command.

However, it will routinely end up naming the
table "ImportOriginal1". If I step through the
procedure, this error will not occur. I have added
currentdb().tabledefs.refresh and dbengine.idle
(dbrefresh) before each statement. However, the error
still occurs in normal runtime.

Is there another command I can call to ensure that the
table is named properly? Or, is there a better way to do
this.

thanks,

Justin

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Back
Top