Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.
That worked fine when the add-in was run as a stand-alone application, but when run as an add-in it generated error:
Public Function CreateModule(ModuleName As String) As Boolean Dim db As DAO.Database Dim doc As Document Dim NewMod As Module On Error GoTo ProcError Set doc = Currentdb.Containers("Modules").Documents(ModuleName) CreateModule = True ProcExit: Set db = Nothing Exit Function ProcError: If Err.Number = 3265 Then DoCmd.RunCommand acCmdNewObjectModule Set NewMod = Application.Modules.Item(Application.Modules.Count - 1) DoCmd.Save acModule, NewMod.Name DoCmd.Close acModule, NewMod.Name, acSaveYes DoCmd.Rename ModuleName, acModule, NewMod.Name CreateModule = True Else MsgBox Err.Number & vbCrLf & Err.Description, , "CreateModule" Debug.Print "CreateModule", Err.Number, Err.Description Resume ProcExit End If End Function
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
20 Experts available now in Live!