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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I rename the table from the code?

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
Hi

I am wondering if I could rename the table using vba code...

Thanks
 
absolutely. here is an example from Access97 help:
DoCmd.Rename "Old Employees Table", acTable, "Employees"
 
Hi!

Here's code for DAO:

dim dbs as database
dim tdf as tabledef

set dbs=currentdb
set tdf=currentdb.tabledefs("MyTableName")
tdf.name="NewNameOfMyTable"
dbs.close
set dbs=nothing


Aivars
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top