Note that there are some explanatory texts on larger screens.

plurals
  1. POIntermittent error when attempting to control another database in VBA
    primarykey
    data
    text
    <p>I have the following code:</p> <pre><code>Dim obj As New Access.Application obj.OpenCurrentDatabase (CurrentProject.Path &amp; "\Working.mdb") obj.Run "Routine" obj.CloseCurrentDatabase Set obj = Nothing </code></pre> <p>The problem I'm experimenting is a pop-up that tells me Access can't set the focus on the other database. As you can see from the code, I want to run a Subroutine in another mdb. Any other way to achieve this will be appreciated.</p> <p>I'm working with MS Access 2003.</p> <p>This is an intermittent error. As this is production code that will be run only once a month, it's extremely difficult to reproduce, and I can't give you the exact text and number at this time. It is the second month this happened.</p> <p>I suspect this may occur when someone is working with this or the other database.</p> <p>The dataflow is to update all 'projects' once a month in one database and then make this information available in the other database.</p> <p>Maybe, it's because of the first line in the 'Routines' code: If vbNo = MsgBox("Do you want to update?", vbYesNo, "Update") Then Exit Function End If</p> <p>I'll make another subroutine without the MsgBox.</p> <p>I've been able to reproduce this behaviour. It happens when the focus has to shift to the called database, but the user sets the focus ([ALT]+[TAB]) on the first database. The 'solution' was to educate the user.</p> <hr> <p>This is an intermittent error. As this is production code that will be run only once a month, it's extremely difficult to reproduce, and I can't give you the exact text and number at this time. It is the second month this happened.</p> <p>I suspect this may occur when someone is working with this or the other database.</p> <p>The dataflow is to update all 'projects' once a month in one database and then make this information available in the other database.</p> <p>Maybe, it's because of the first line in the 'Routines' code: If vbNo = MsgBox("Do you want to update?", vbYesNo, "Update") Then Exit Function End If</p> <p>I'll make another subroutine without the MsgBox.</p> <hr> <p>I've tried this in our development database and it works. This doesn't mean anything as the other code also workes fine in development.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload