• Opening A Form In Another Database (Access2002)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Opening A Form In Another Database (Access2002)

    Author
    Topic
    #430857

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

    Viewing 1 reply thread
    Author
    Replies
    • #1007112

      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?

      • #1007122

        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.

        • #1007124

          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

          • #1007432

            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?

            • #1007444

              Minimized? Or restored?

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

              app.DoCmd.Maximize

            • #1007446

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

            • #1007459

              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?

            • #1007475

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

            • #1007476

              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

            • #1007483

              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.

    • #1007113

      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.

    Viewing 1 reply thread
    Reply To: Opening A Form In Another Database (Access2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: