- 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>
53 lines
1.1 KiB
Plaintext
53 lines
1.1 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 = True
|
|
|
|
WScript.Echo "Creating test form..."
|
|
|
|
' Creer un formulaire simple
|
|
accessApp.DoCmd.NewObject 2, "frm_Test", "Normal" ' 2 = acForm
|
|
|
|
WScript.Sleep 1000
|
|
|
|
' Ouvrir en mode Design
|
|
accessApp.DoCmd.OpenForm "frm_Test", 2
|
|
|
|
WScript.Sleep 500
|
|
|
|
' Activer HasModule
|
|
WScript.Echo "Setting HasModule = True..."
|
|
accessApp.Forms("frm_Test").HasModule = True
|
|
|
|
If Err.Number = 0 Then
|
|
WScript.Echo "SUCCESS! HasModule activated for test form"
|
|
|
|
' Sauvegarder
|
|
accessApp.DoCmd.Close 2, "frm_Test", 1
|
|
|
|
WScript.Sleep 500
|
|
|
|
' Verifier
|
|
Dim vbProj
|
|
Set vbProj = accessApp.VBE.VBProjects(1)
|
|
|
|
Dim comp
|
|
For Each comp In vbProj.VBComponents
|
|
If comp.Name = "Form_frm_Test" Then
|
|
WScript.Echo "Module created! Type: " & comp.Type
|
|
Exit For
|
|
End If
|
|
Next
|
|
Else
|
|
WScript.Echo "FAILED: " & Err.Description
|
|
End If
|
|
|
|
WScript.Echo "Press OK to close."
|
|
|
|
accessApp.CloseCurrentDatabase
|
|
accessApp.Quit
|
|
Set accessApp = Nothing
|