Forum Discussion
Run-time Error '3340'
I have this Access error. I have Office 365 and I have followed the suggestion to update my Office version within Access. I have done this and now have version 1910 Build 12130.20410 Click-to-Run. This is the latest update. The error still persists. Please help !!!
Não altere as tabelas nem consultas, use apenas o meu código e adapte a chamada de execução
Sub UPDATE(strNomeTab As String, strInstrucaoSET As String, Optional MostraQtAlterados As Boolean = False)
'--------------------------------------------------------------'
' código criado por Alexandre Neves, do Fórum MaximoAccess '
' utilize o código livremente mas mantenha os créditos '
'--------------------------------------------------------------'
'Exemplo com opção de mostrar quantidade de registos afectados
'Call UPDATE("Tabela","Campo=X",True) em vez de UPDATE Tabela SET Campo=X
'Exemplo com opção de mostrar quantidade de registos afectados
'Call UPDATE("Tabela","Campo=X") em vez de UPDATE Tabela SET Campo=X
Dim qdf As QueryDef
Set qdf = CurrentDb.CreateQueryDef("qdf" & strNomeTab, "SELECT * FROM " & strNomeTab)
If MostraQtAlterados Then
With CurrentDb
.Execute "UPDATE qdf" & strNomeTab & " SET " & strInstrucaoSET
MsgBox .RecordsAffected
End With
Else
CurrentDb.Execute "UPDATE qdf" & strNomeTab & " SET " & strInstrucaoSET
End If
CurrentDb.Execute "DROP TABLE qdf" & strNomeTab
End Sub