for you wath code speed up the query execution:
or directlly:Code:.... SQL = "SELECT SP from tab1 WHERE DT='" & Me.DT3.Text & "'GROUP BY SP" .... Set RST0 = New ADODB.Recordset With RST0 .CursorType = adOpenKeyset .CursorLocation = adUseClient .LockType = adLockReadOnly End With Set CMD = New ADODB.Command With CMD .CommandTimeout = 0 .CommandText = SQL .ActiveConnection = CONN .CommandType = adCmdText '.Prepared = True DoEvents Set RST0 = .Execute Set CMD = Nothing End With ....
note:Code:With RST0 .CursorType = adOpenKeyset .CursorLocation = adUseClient .LockType = adLockReadOnly End With Set RST0= New ADODB.Recordset RST0.Open sql, CONN, adOpenKeyset, adLockOptimistic, adCmdtext
are approx 75.xxx records in access table:-(




Reply With Quote