Calling a subroutine in a second database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beebelbrox
    New Member
    • Aug 2007
    • 20

    Calling a subroutine in a second database

    Greetings,

    I am stuck on this. Is it possible to have a subroutine in one database call a subroutine in a second database. my attempt below produces an error. The error i get is "compile error sub or function not defined"

    My guess is I'm not opening the second DB correctly

    Thanks,

    B


    Code:
        ':><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><:
        
        'Call rec subroutine in second database
        
        ':><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><::><:
    
        Set wsJet = DBEngine(0)
        Set dbJet = wsJet.OpenDatabase(strRecDB, False, True)
    
         'strRecDB is a string variable for the path name to the second DB
        
        Debug.Print "JetDB "; wsJet.Databases.Count & _
            "-" & CurrentDb.Name
        
        Call CallAS400
                
            
            
    
    
    dbJet.Close
    Set dbJet = Nothing
        
        
        
        DoCmd.SetWarnings True
Working...