M
MVP - WannaB
Hello, I've had my own problems with update queries and "Key Violations" and
thought that what I used the last time I ran an update query that kept giving
me "Key Violations" might be usfull to someone else.
First none of this is my own, I've learned it all here. It's just the way
in which I used what I learned here that might be helpful to someone else.
When you simply run an update or an append query and get that OH SO
descriptive MS message that tell you there are violation of one sort of
another, this may help because it provide more information.
Create a Module, Paste this VBA code in, replace <ENTER QUERY NAME HERE>
with your query name, and step through the procedure with F8.
Public Sub QryTest()
Dim StrSql As String
Dim dbs As DAO.Database
Set dbs = CurrentDb()
StrSql = "<ENTER QUERY NAME HERE>"
dbs.Execute StrSql, dbFailOnError
Set dbs = Nothing
End Sub
thought that what I used the last time I ran an update query that kept giving
me "Key Violations" might be usfull to someone else.
First none of this is my own, I've learned it all here. It's just the way
in which I used what I learned here that might be helpful to someone else.
When you simply run an update or an append query and get that OH SO
descriptive MS message that tell you there are violation of one sort of
another, this may help because it provide more information.
Create a Module, Paste this VBA code in, replace <ENTER QUERY NAME HERE>
with your query name, and step through the procedure with F8.
Public Sub QryTest()
Dim StrSql As String
Dim dbs As DAO.Database
Set dbs = CurrentDb()
StrSql = "<ENTER QUERY NAME HERE>"
dbs.Execute StrSql, dbFailOnError
Set dbs = Nothing
End Sub