rename tables

  • Thread starter Thread starter Joseph Smith
  • Start date Start date
J

Joseph Smith

every now and again I need to link tables to sql they come through with dbo_
and then the name I then have to manually rename the table, easier than
changing existing code.

Can anyone please tel me how I can maybe change the name of the table by
macro or code?

Many thanks.

JS.
 
Tables are objects and can be renamed, deleted, what have you the sam
as anything else. Look up the Table object, the Tables container, an
TableDefs... in there lies your answer
 
Joseph,

Try this line of code:

currentdb().tabledefs("OldTableName").name = "NewTableName"

HTH,
Nikos
 
Back
Top