I know it must be something simple but I've been searching the forum most of the day and am not putting 2+2 together.
I've been doing this with update queries but they take much too long to run and I need to figure out how to build more effective applications. The bit below is just for one field I actually will be reproducing this to populate numerous fields the docmd.openquery way takes nearly 30 minutes to run.
Your help would be greatly appreciated, thanks in advance.
Code:
Public Function UpdateAcctRep()
Dim db As dao.Database
Dim rs As dao.Recordset
Dim strSQL As String
Set db = CurrentDb
Set rs = db.OpenRecordset("tTempCompany")
While Not rs.EOF
strSQL = "UPDATE [tTempCompany] SET tTempCompany.[Account Rep] = [chuserID], WHERE (((tTempCompany.iCompanyId = dbo_ContactInternal.iOwnerID and dbo_ContactInternal.iContactTypeId) In (125,151)) AND dbo_ContactInternal.tiRecordStatus)=1"
rs.MoveNext
Wend
Set rs = Nothing
Set db = Nothing
End Function
Last edited: