Results 1 to 12 of 12
  1. #1
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Opening A Form In Another Database (Access2002)

    How do I use a command button to open a form that's in another database?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Opening A Form In Another Database (Access2002)

    You'd have to start a separate instance of Access, open the other database in that instance and then open the form. Since it is opened in another instance of Access, the form will have nothing to do with the current database. Do you have a *really* good reason to want this?

  3. #3
    Star Lounger
    Join Date
    Nov 2005
    Location
    Edmonton, Alberta, Canada
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Opening A Form In Another Database (Access2002)

    I've been playing around with this (the idea in my case is to get users in any of several databases to be able to record questions in a single database). What I did was define the other database as a reference in the first database (Alt-F11 in the first database, go to Tools | References..., click the Browse button, change the "Files of type" dropdown to "Microsoft Office Access Databases", and find the other database).

    Once I set the other database as a reference, in the first database I called a public subroutine that is in the other database (no special syntax - it will look there as well as your current database once the reference is set). That public subroutine opened the form that I wanted in the other database.

  4. #4
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Opening A Form In Another Database (Access2002)

    I have responsibility for a Database that uses information (links to another database) from another Database. However; I don't have responsibilty for that information; I don't manage that unit. I link to the database and have a form that displays the information. Let's say the user reviews the information and determines that they want to modify the linked information. I want to be able to have the current form use a command button to open the database and the form; so the user can modify the information. The users folder rights will be checked to make sure that the user has write/update rights; to update the information in the recently open database.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Opening A Form In Another Database (Access2002)

    Have you tried dmartin's suggestion?

    Using Automation, you could do this:

    Dim app As New Access.Application
    app.OpenCurrentDatabase "OtherDatabase.mdb"
    app.DoCmd.OpenForm "frmSomething"
    app.Visible = True
    Set app = Nothing

  6. #6
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Opening A Form In Another Database (Access2002)

    Thanks Very Much; Your "Automation" code worked; however opens the form in the minimized format. I liked the form to be opened in the max format. Any Ideas?

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Opening A Form In Another Database (Access2002)

    Minimized? Or restored?

    Anyway, insert this line below the DoCmd.OpenForm line:

    app.DoCmd.Maximize

  8. #8
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Opening A Form In Another Database (Access2002)

    Tried that already; before I responded. I guess I should have stated that. Sorry.

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Opening A Form In Another Database (Access2002)

    What exactly do you mean then? Do you want the Access application window to be maximized, or do you want the form to be maximized?

  10. #10
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Opening A Form In Another Database (Access2002)

    I want both the application window and the form to be opened and be maximized

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Opening A Form In Another Database (Access2002)

    The line

    app.DoCmd.Maximize

    should maximize the form within the Access window. And use the following line in the Automation code to maximize the application window:

    app.RunCommand acCmdAppMaximize

  12. #12
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Opening A Form In Another Database (Access2002)

    Thanks again it did the job; after re-reading your post and looking at the form as it opened. The form was always maximized; it was the Access Application Window that was not maximized. Once again thanks for your assistance.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •