I have the following count taking place in my Access VBA code. Sometimes it works, and sometimes it doesnt. Seems the timeout is at 60 and I cant figure out how to change it to 600.
If it errors I'm getting a 3146 ODBC - call failed error
If it errors I'm getting a 3146 ODBC - call failed error
Code:
Public Function GetQueryCount7C() As Long
CurrentDb.QueryTimeout = 0
Dim rst As DAO.Recordset
Dim sql As String
sql = "SELECT COUNT(*)/ 2500 + 1 AS total " _
& "FROM Boyd0315Final INNER JOIN " _
& "InventorySuppliers ON Boyd0315Final.EAN = InventorySuppliers.LocalSKU " _
& "WHERE (InventorySuppliers.SupplierID = 315) AND (Boyd0315Final.Cost is not null) AND (InventorySuppliers.Cost <> Boyd0315Final.Cost) OR " _
& "(InventorySuppliers.SupplierID = 315) and (Boyd0315Final.QOH IS NOT NULL) AND (InventorySuppliers.BoydQuantityAvailable <> Boyd0315Final.QOH)"
Set rst = CurrentDb.OpenRecordset(sql)
With rst
If Not .EOF Then
GetQueryCount7C = .Fields(0).Value
End If
.Close
End With
Set rst = Nothing
End Function
Comment