DAO CurrentProject vs. CurrentDb RRS feed

  • Question

  • I have an Access 2007 database developed and distributed using Runtime called ORCAS. Some users may have MSACCESS on their computers and some may not. I have an opening form that sets certain options and directories and such. Two of the VBA commands at startup are:

    Dim ORCAS As DAO.Database
    Set ORCAS = Application.CurrentDb


    1. What is the difference between Set ORCAS = Application.CurrentDb and Set ORCAS = Application.CurrentProject?

    2. Is one preferrable over another?

    3. Are these commands only applicable to the opening form or do they set the environment for the whole database (project)? Do you need to set them for each form that is opened?

    4. Should Dim ORCAS As DAO.Database be in General Declarations on the opening form instead of the Private Sub OnOpen event?

    5. What is the preferred way to set the database environment when it is opened?

    I should say I have tried to understand these overall environment settings in the Access 2007 Developer Reference website but I am confused on which ones to use and where to use them.

    Thank you so much for any quidance.


    Thursday, October 6, 2011 5:23 PM


All replies