DAO.DBEngine.SetOption dbMaxLocksPerFile, 1500000 Dim Conn As ADODB.Connection Dim rst As New ADODB.Recordset Dim strSQL As String Set Conn = CurrentProject.Connection Set rst = New ADODB.Recordset strSQL = "Select * from vicidial_agent_log_temp order by user, event_time" rst.Open strSQL, Conn, adOpenKeyset, adLockOptimistic Dim Time, time_alt As Date Dim summe, summe_alt, differenz, temp As Integer Dim user_alt As String Do Until rst.EOF 'Bei neuem Agent springe zum naechsten Datensatz If .... Then GoTo naechster_datensatz End If summe = rst!pause + rst!wait If summe_alt ... Then rst.MovePrevious rst!gabcom_fehler = "AutoKorrektur" 'ein paar Änderungen ausführen End If naechster_datensatz: 'Werte übermitteln in Variable user_alt = rst!user time_alt = rst!event_time summe_alt = rst!pause_sec + rst!wait_sec + rst!dispo_sec + rst!talk_sec naechster_datensatz: rst.MoveNext Loop rst.Close