Results 1 to 2 of 2
  1. #1
    Goodge12 is offline Novice
    Windows XP Access 97
    Join Date
    Sep 2008
    Posts
    25

    Can open a form in different DB, but can't use it...

    Hi All-
    I have 2 databases, each with a form and each form has a button...

    -dbA
    -frmA
    -btnA
    -dbB
    -frmB
    -btnB

    In database (dbA), form (frmA), I was able to create a button (btnA) that opens a form (frmB) in a different database (dbB).



    However, when I click button (btnB) in frmB, dbB closes immediately. When I click btnB in dbB when opened without using btnA, it runs the select query I have assigned to it.

    Any thoughts?

    Here is the VBA for btnA:
    Code:
    Public Sub Command1_Click()
    
    Dim appAccess As Access.Application
    Set appAccess = CreateObject("Access.Application")
    appAccess.OpenCurrentDatabase "I:\myLocation\dbB.accdb"
    appAccess.DoCmd.OpenForm "frmB"
    Set appAccess = Nothing
    
    End Sub

  2. #2
    Goodge12 is offline Novice
    Windows XP Access 97
    Join Date
    Sep 2008
    Posts
    25
    Got it... the button in the second db was set to embedded macro rather than event procedure. *Facepalm*

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 06-13-2012, 05:57 AM
  2. Replies: 2
    Last Post: 05-11-2012, 11:52 AM
  3. Replies: 1
    Last Post: 05-03-2012, 02:25 PM
  4. Replies: 11
    Last Post: 01-26-2012, 01:22 PM
  5. Replies: 2
    Last Post: 02-26-2010, 08:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums