Hi folks,
Need some help! I'm getting this error:
Run-time error '3065': Cannot execute a select query.
Here is the code:
' if no contacts set for delete, skip the cleanup
strSQL = "SELECT * FROM tblContact " & _
"WHERE (((tblContact.cont_projectID)='" & strProjectID & "' Or (tblContact.cont_projectID) Is Null) AND ((tblContact.cont_active_status)='D'));"
Set myCountQuery = myDB.CreateQueryDef("", strSQL)
myCountQuery.Execute ' Run temporary QueryDef
Is it the SQL string? I have updated tblContact earlier on in the code, using a DAO recordset, also using a transaction and have definitely commited the updates.
Any help would be greatly appreciated! Thanks.
Need some help! I'm getting this error:
Run-time error '3065': Cannot execute a select query.
Here is the code:
' if no contacts set for delete, skip the cleanup
strSQL = "SELECT * FROM tblContact " & _
"WHERE (((tblContact.cont_projectID)='" & strProjectID & "' Or (tblContact.cont_projectID) Is Null) AND ((tblContact.cont_active_status)='D'));"
Set myCountQuery = myDB.CreateQueryDef("", strSQL)
myCountQuery.Execute ' Run temporary QueryDef
Is it the SQL string? I have updated tblContact earlier on in the code, using a DAO recordset, also using a transaction and have definitely commited the updates.
Any help would be greatly appreciated! Thanks.