importing

  • Thread starter Justin Donaldson
  • 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
 
J

John Nurick

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top