Renaming Tables

chamill
05-24-2001, 05:11 AM
Could anyone tell me if it is possible to rename an Access table from VBA code

I would appreciate any help

Thanks

PWNettle
05-24-2001, 10:10 AM
If you are in Access VBA you can do it with:
<PRE> DoCmd.Rename "newtablename", acTable, "oldtablename"</PRE>If you are not in Access VBA it's possible to make a reference to Access to do this. If you need an example reply and let me know.

Paul

karimahta
05-25-2001, 05:12 AM
In Access use:
<pre><font color=blue>CurrentDb.TableDefs("tblClients").Name = "tblClientsNew"</pre></font color=blue>

OR
when using DAO references in another application:
<pre><font color=blue>
Dim dbRef as DAO.Database

' Open database, etc
....
....

dbRef.TableDefs("tblClients").Name = "tblClientsNew"</pre></font color=blue>


HTH

<font color=blue>Better to remain a fool than write a quote and remove all doubt. (****!!)</font color=blue>

chamill
05-30-2001, 03:42 AM
Both solutions worked fine

Thanks Lads

Conor M Hamill

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum