On Error Resume Next Dim accessApp Set accessApp = CreateObject("Access.Application") accessApp.OpenCurrentDatabase "C:\Users\alexi\Documents\projects\timetrack-pro\db\TimeTrackPro.accdb" WScript.Echo "=== Renaming orphan Form_* Type 1 modules ===" Dim vbProj Set vbProj = accessApp.VBE.VBProjects(1) Dim modulesToRename modulesToRename = Array("Form_frm_Accueil", "Form_frm_Clients", "Form_frm_Projets", "Form_frm_Historique") Dim i For i = LBound(modulesToRename) To UBound(modulesToRename) Dim comp Set comp = Nothing Dim c For Each c In vbProj.VBComponents If c.Name = modulesToRename(i) And c.Type = 1 Then Set comp = c Exit For End If Next If Not comp Is Nothing Then Dim newName newName = "OLD_" & modulesToRename(i) WScript.Echo "Renaming: " & comp.Name & " -> " & newName comp.Name = newName WScript.Echo " -> Renamed!" Else WScript.Echo "Not found or not Type 1: " & modulesToRename(i) End If Next WScript.Echo "" WScript.Echo "=== Remaining Form_* modules ===" For Each c In vbProj.VBComponents If Left(c.Name, 5) = "Form_" Then WScript.Echo c.Name & " - Type: " & c.Type End If Next accessApp.CloseCurrentDatabase accessApp.Quit Set accessApp = Nothing