- Test and helper VBS scripts for VBA MCP development - Technical reference documentation and PDFs - HTML form templates for all 5 forms - PowerShell and Python scripts for PDF/documentation generation Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
57 lines
1.3 KiB
Plaintext
57 lines
1.3 KiB
Plaintext
On Error Resume Next
|
|
|
|
Dim accessApp
|
|
Set accessApp = CreateObject("Access.Application")
|
|
|
|
accessApp.OpenCurrentDatabase "C:\Users\alexi\Documents\projects\timetrack-pro\db\TimeTrackPro.accdb"
|
|
accessApp.Visible = False
|
|
|
|
Dim vbProj
|
|
Set vbProj = accessApp.VBE.VBProjects(1)
|
|
|
|
' Liste des formulaires
|
|
Dim formNames
|
|
formNames = Array("frm_Accueil", "frm_Clients", "frm_Projets", "frm_SaisieTemps", "frm_Historique")
|
|
|
|
Dim i
|
|
For i = LBound(formNames) To UBound(formNames)
|
|
WScript.Echo "Processing " & formNames(i) & "..."
|
|
|
|
' Ouvrir en mode Design
|
|
accessApp.DoCmd.OpenForm formNames(i), 2 ' acDesign
|
|
WScript.Sleep 500
|
|
|
|
' Activer HasModule
|
|
accessApp.Forms(formNames(i)).HasModule = True
|
|
|
|
WScript.Sleep 500
|
|
|
|
' Fermer et sauvegarder
|
|
accessApp.DoCmd.Close 2, formNames(i), 1 ' acSaveYes
|
|
|
|
If Err.Number = 0 Then
|
|
WScript.Echo " -> Module created for " & formNames(i)
|
|
Else
|
|
WScript.Echo " -> ERROR: " & Err.Description
|
|
Err.Clear
|
|
End If
|
|
|
|
WScript.Sleep 500
|
|
Next
|
|
|
|
WScript.Echo ""
|
|
WScript.Echo "=== Verification ==="
|
|
|
|
' Verifier les modules
|
|
Dim comp
|
|
For Each comp In vbProj.VBComponents
|
|
WScript.Echo comp.Name & " - Type: " & comp.Type
|
|
Next
|
|
|
|
accessApp.CloseCurrentDatabase
|
|
accessApp.Quit
|
|
Set accessApp = Nothing
|
|
|
|
WScript.Echo ""
|
|
WScript.Echo "Done!"
|