Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[blue]
Public Function SaveCodeModules()
Dim dbs As DAO.Database
Dim strCode As String
Dim vbComp
Dim a
Dim fs
Set dbs = CurrentDb
For Each vbComp In vbe.VBProjects(1).VBComponents
With vbComp
strCode = .CodeModule.Lines(1, .CodeModule.CountOfLines)
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("C:\Code\" & .Name & ".txt")
a.Write strCode
a.Close
End With
Next vbComp[/blue]
[red]
Dim frm As Form
Dim rpt As Report
Dim obj As AccessObject
For Each obj In CurrentProject.AllForms
DoCmd.OpenForm obj.Name, acDesign
Set frm = Forms(obj.Name)
frm.HasModule = False
DoCmd.Close acForm, frm.Name, acSaveYes
Next
For Each obj In CurrentProject.AllReports
DoCmd.OpenReport obj.Name, acDesign
Set rpt = Reports(obj.Name)
rpt.HasModule = False
DoCmd.Close acReport, rpt.Name, acSaveYes
Next
[/red]
End Function