none
open a form in a different database RRS feed

  • Question

  • Hi all,

    I have 2 databases that are linked / integrated with each other. Lets call them DB1 and DB2.

    When working in DB2, the user can access data in DB1 to process transactions, and vice versa. Tables are linked between the 2 databases.

    My question:

    When working on DB2, is it possible to open a form in DB2 that resides in DB1 and update the data in DB1?

    For example, lets say the user realises that the company info is incorrect while working in DB2. Can the Frm_Company in DB1 be opened from DB2 and the changes made to DB1?

    Much appreciated.

    Deon

    Friday, August 23, 2019 7:00 AM

Answers

  • Can the Frm_Company in DB1 be opened from DB2 and the changes made to DB1?

    Hi Deon,

    Long time ago I also tried to open a form in an external database. Though it is possible (with the right extension of the database file) to execute code in an external database, I did not succeed well enough.

    Then I changed to a shared library database, and abandonned the whole idea. Today with the shared library database and generalized forms, I can realize what i want.

    Perhaps you could place both forms in a library database, and see if this gives you the wanted possibilities.

    Imb.

    • Marked as answer by Deon SA Monday, August 26, 2019 8:26 AM
    Friday, August 23, 2019 7:29 AM

All replies

  • Can the Frm_Company in DB1 be opened from DB2 and the changes made to DB1?

    Hi Deon,

    Long time ago I also tried to open a form in an external database. Though it is possible (with the right extension of the database file) to execute code in an external database, I did not succeed well enough.

    Then I changed to a shared library database, and abandonned the whole idea. Today with the shared library database and generalized forms, I can realize what i want.

    Perhaps you could place both forms in a library database, and see if this gives you the wanted possibilities.

    Imb.

    • Marked as answer by Deon SA Monday, August 26, 2019 8:26 AM
    Friday, August 23, 2019 7:29 AM
  • Instead of trying to open a form that resides the other database DB1, open a form in the current database DB2 that is bound to a table in DB2 that is linked to DB1. Any changes to the data will be saved in the source table in DB1.

    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Friday, August 23, 2019 12:28 PM
  • Hi Deon

    I am  not sure of your databases and its structure. But maybe this can be a way forward?
    You need three databases. Two of them are FrontEnd databases, containing Forms, Reports, Macros; Modules. One, the third, is a BackEnd database, containing just tables.

    Lets call them DB1, DB2 and DB3. 1 and 2 is FE and 3 is the BE.

    The content of DB1 and DB2 is different to its most. But they have some Forms that are totally alike, like your Frm_Company.

    DB1 and DB2 are linked to the same tables in DB3.


    Cheers // Peter Forss Stockholm


    Saturday, August 24, 2019 9:19 AM
  • When working on DB2, is it possible to open a form in DB2 that resides in DB1 and update the data in DB1?
    It is possible by creating a reference in the current databsae to the external database (Tools | References on the VBA menu bar).  In the external database create a Public function in a standard module to open the form.  The function will be exposed to the current database and can be called to open the form.

    Ken Sheridan, Stafford, England

    Saturday, August 24, 2019 11:07 PM
  • When working on DB2, is it possible to open a form in DB2 that resides in DB1 and update the data in DB1?

    It is possible by creating a reference in the current databsae to the external database (Tools | References on the VBA menu bar).  In the external database create a Public function in a standard module to open the form.  The function will be exposed to the current database and can be called to open the form.

    Ken Sheridan, Stafford, England

    That's a good one, Ken.

    However, I'm not sure whether there are any users going to open that DB1. Using it as a Reference, it may locked out the DB1.

    I guess OP have to think about this.

    Monday, August 26, 2019 2:42 AM
  • Hi Imb,

    This works well as I have other databases that uses the same form as I use a standard form throughout all my databases for the Company tables.

    Regards

    Deon

    Monday, August 26, 2019 8:26 AM
  • However, I'm not sure whether there are any users going to open that DB1. Using it as a Reference, it may locked out the DB1.
    Other users can open the referenced database, though not exclusively of course.  Normal locking mechanisms will apply as below:

    If an optimistic locking strategy has been applied in the referenced database, and, while the form is dirty in the current database, another users edits and saves the same record in the referenced database, the user of the current database will receive the usual dialogue inviting them to overwrite the other user's changes or abandon their own changes.

    If a pessimistic locking strategy has been applied, neither user will be able to edit a record which is currently uncommitted in the other database.  The record selector will show the usual 'No Entry' symbol in this case.


    Ken Sheridan, Stafford, England

    Monday, August 26, 2019 10:50 AM