We help IT Professionals succeed at work.

Database not opening when using VBA

I have an ACCESS 2003 database that I am using to open other databases.  This "menu" database only has one form and on that button that open other databases.  However, I am trying to set up the first database and while the "child" database has an lb file saying I am in it, I cannot see the database.  

Private Sub lblCAR_Click()
Dim appAccess As Access.Application
Dim strDB As String

Const strConPathToSamples = "\\Sf1\User1\" & _
        "shared\DepositServices\CIA\SOS_APPLICATIONS\LM_Reporting\"

    strDB = strConPathToSamples & "LMR_FE_UserTesting.mdb"
    ' Create new instance of Microsoft Access.
    Set appAccess = CreateObject("Access.Application")
    ' Open database in Microsoft Access window.
    appAccess.OpenCurrentDatabase strDB


End Sub
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016
Commented:
appAccess.OpenCurrentDatabase strDB

appAccess.Usercontrol=true   '<<< ADD this line
Sandra SmithRetired

Author

Commented:
That did it, thank you.

Sandra

Explore More ContentExplore courses, solutions, and other research materials related to this topic.