How to make a newly opened DB (opened via VBA) visible

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MarkBStewart
    New Member
    • May 2010
    • 20

    How to make a newly opened DB (opened via VBA) visible

    I have worked through the open syntax to open a database from VBA, but the database does not appear to actually open. Here is the code:

    Dim MyConn As ADODB.Connectio n
    Dim MyRecordSet As ADODB.Recordset

    Set MyConn = New ADODB.Connectio n
    MyConn.Connecti onString = "Provider=Micro soft.ACE.OLEDB. 12.0; Data Source=c:\Tools \Test_DB.accdb; Persist Security Info=False;"

    MyConn.Open

    I have opened up the Windows Task Manager to watch and see if another instance of Access opens when this code executes, but it does not appear to.

    How do I make the newly opened DB actually open and be visible? Inother words, I want the new DB to open and go to the default form as if I double-clicked on the Access icon. Thx
    Last edited by MarkBStewart; May 26 '10, 04:55 PM. Reason: More detail added
  • vb5prgrmr
    Recognized Expert Contributor
    • Oct 2009
    • 305

    #2
    You cannot make it visible with the methods you are using because you are actually using the DAO/Jet engine to access the file and the data it contains, just like access does. To spawn access, use the shell function if it is available in VBA, else shellexecute API if you can use such in VBA...



    Good Luck

    Comment

    • MarkBStewart
      New Member
      • May 2010
      • 20

      #3
      Thank you for your answer. Using the methods I am using can I access the tables and forms in the external copy of Access? Thx

      Comment

      Working...