randolphoralph
Registered User.
- Local time
- Today, 01:57
- Joined
- Aug 4, 2008
- Messages
- 101
I have Access database in a multi-user environment over a 10/100Mb network. I am using a DLookup on the Employee ID field to return a employee's workload for a certain date and employee ID.
I have noticed the database takes 3-10 minutes on this field for users not located at the same location as the server where the database is.
The database has 6,000 records in it, and growing every day.
Here is the code I suspect is causing the issue. Any thoughts on a better way to do this would be appreciated.
I have noticed the database takes 3-10 minutes on this field for users not located at the same location as the server where the database is.
The database has 6,000 records in it, and growing every day.
Here is the code I suspect is causing the issue. Any thoughts on a better way to do this would be appreciated.
Code:
Private Sub EmployeeID_BeforeUpdate(Cancel As Integer)
'Looks up the Workload if the EmployeeID and Dateofwork is the same as the current record.
Dim Workload4 As Long
If Len(Me.EmployeeID & "") > "0" Then
Workload4 = Nz(DLookup("[Workload]", "[Audits1]", "[EmployeeID] = " & Forms![Audits1]![EmployeeID] & " AND [DateofWork] =#" & Forms![Audits1]![DateofWork] & "#"), 0)
Me.Workload = Workload4
Else
Me.Workload = ""
End If
End Sub