So I've pinpointed, or at least narrowed down the cause of the problem. It seems to be related to the "persistent connection" code that I added to this project. I've tried different versions of the code in the original post and the problem persists. All I have to do to solve the problem is remove the persistent connection described next.
There is a query in this project that ran fine with only one user connected, but VERY slowly if more than one was connected. So I followed advice in a forum and added the persistent connection using a startup form with this code:
Code:
Option Compare Database
Dim dbsAlwaysOpen As DAO.Database
Private Sub Detail_Click()
End Sub
Private Sub Form_Close()
Set dbsAlwaysOpen = Nothing
End Sub
Private Sub Form_Open(Cancel As Integer)
Set dbsAlwaysOpen = OpenDatabase("M:\Data\My Data.mdb", False)
'MsgBox ("Debug: Opened connection to database")
End Sub
This persistent connection fixed the problem of the slow query when more than one user is connected. Can someone tell me why it would cause a delay when running the small routine in my first post?
As you can see, the backend BD is in a shared network location, accessed by shared network drive. Until recently the front-end database was also in a shared network location, with all users connecting to the same .mdb. But I've tried having users copy the FE file to their local PCs and running it from there... same problem.
I have a feeling I'm missing some simple, common step that should be taken when deploying an Access app with FE and BE files.
thanks in advance,
baulrich