Confirming Other Users

N

Nick hfrupn

I am using a shared 2000 database. When a person opens the database a
start-up form opens and does the Event Procedure on Load as per below.
The problem is the delete and import happen each time a user starts up
regardless if other users are connected. This slows the database because this
process involves anywhere from 10,000 to 30,000 records.

What I would like is, when multiple users are logged on at the same time,
this event happens for the first user who logs on but not for the other
users. So when the second and subsequent users log the delete and import
process does not happen.

Is this possible?

Regards
Nick

Private Sub Form_Load()
On Error GoTo Form_Load_Err

' Disables action queries
Call Init
' Deletes tbBacklog
DoCmd.OpenQuery "qyDelete_Table_Backlog", acNormal, acEdit
' Imports Backlog.xls
DoCmd.TransferSpreadsheet acImport, 8, "tbBacklog",
DLookup("File_Location", "tbDefaults"), True, ""
' Appends work centres
DoCmd.OpenQuery "qyWorkCentres-Apend_tbWork Centre", acNormal, acEdit
' Appends planner groups
DoCmd.OpenQuery "qyPlannerGroup-Apend_tbPlanner Group", acNormal, acEdit

Form_Load_Exit:
DoCmd.Close
DoCmd.OpenForm "Switchboard"

Exit Sub

Form_Load_Err:
MsgBox Error$
MsgBox "To fix this problem.", vbInformation, ""

Resume Form_Load_Exit

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top