Share via

Switching between two databases on the same computer using VBA.

Anonymous
2023-03-16T17:46:49+00:00

In our production area I have an access database running and I need to be able to have a second database running on it for a different application.  What I would like to know is if it is possible to add a command button to a form in database “A” that when clicked that it will switch control/focus over to database “B”…..ideally to a particular form within that database.  In turn I will also add a button to database “B” that would switch control/focus over to database “A”.

Is the above possible and if so, how would I go about doing it?

Microsoft 365 and Office | Access | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2023-03-16T22:51:08+00:00

    Hi Darren,

    The most simple way is open the two applications, and switch on the task bar to make the other application the active screen.

    But I can imagine that is a too simple situation.

    Probably you want some interference between the data of the two applications.

    Without making a common front end, you can do quit a lot with late binding to the other application.

    It is even possible that a form in the one application can bind to the other application. You can even make a system where it does not make any difference in which back-end the data is stored, or where the form is "defined", but that is more complex.

    So, how far you need or want to go?

    Imb.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2023-03-16T22:50:06+00:00

    Take a look at the VBA help for the DBEngine.OpenDatabase and DBEngineClose methods. These will let you open and close a database using the path and filename.

    Was this answer helpful?

    0 comments No comments
  3. ScottGem 68,830 Reputation points Volunteer Moderator
    2023-03-16T21:47:47+00:00

    Why not have a front end that combines the 2 applications and allows you to switch as needed.

    Was this answer helpful?

    0 comments No comments