Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / April 2005

Tip: Looking for answers? Try searching our database.

rename table with VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mcnewsxp - 08 Apr 2005 14:58 GMT
anybody have a VBA routine to rename tables after an a link to SQL that gets
rid of the "dbo_?"
tia.
mcnewsxp - 08 Apr 2005 15:26 GMT
Public Sub RenameAllTables(strToFind As String, strToReplace)

Dim dbs As Database
Dim tdf As TableDef

Set dbs = CurrentDb
For Each tdf In dbs.TableDefs
   Dim tdfNewName As String

   tdfNewName = Replace(tdf.Name, strToFind, strToReplace)

   If tdfNewName <> tdf.Name Then
       DoCmd.Rename tdfNewName, acTable, tdf.Name
   End If

Next

End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.