Option Explicit Const sDBpath = "C:\Users\ChopperDave64\Documents\Repair Busniess\DB\" Const sDBfileName = "Repair Data Tracking.accdb" Dim bDBopen As Boolean, bInit As Boolean Dim dbRepairBus As DAO.Database Private Sub Class_Initialize() Dim bRes As Boolean bRes = OpenDB() Debug.Print "CCNXtoDB constructor OpenDB = " & bRes End Sub Function OpenDB() As Boolean Set dbRepairBus = DAO.DBEngine.OpenDatabase(sDBpath & sDBfileName) ' <-- Causes run time error 3343 bDBopen = True OpenDB = bDBopen End Function
Function TestClass() As Boolean Dim RepairDB As CNXtoDB Set RepairDB = New CNXtoDB Debug.Print RepairDB.OpenDB End Function
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.