StampIT
asked on
Append query break in VBA
Trying to execute an append query in VBA code with the following statement:
db.Execute "qraBOLPreArch". When I step through the code I can see that it executes however the table does not get updated. If I run the query in Access it runs fine. Is there another method I need to use to execute an append query in code? Thanks.
db.Execute "qraBOLPreArch". When I step through the code I can see that it executes however the table does not get updated. If I run the query in Access it runs fine. Is there another method I need to use to execute an append query in code? Thanks.
ASKER
mx,
I don't get anything. The code completes as if there is nothing wrong.
I don't get anything. The code completes as if there is nothing wrong.
ok. What is the SQL for the query ?
mx
mx
Please post the whole procedure/function and the query object's SQL statement. I just tested on A2010, and it worked fine for me.
Re: "Is there another method I need to use to execute an append query in code?"
Personally, I prefer building the SQL statement in a code string variable (strSQL) and running
Lee
Re: "Is there another method I need to use to execute an append query in code?"
Personally, I prefer building the SQL statement in a code string variable (strSQL) and running
db.Execute strSQL, dbFailOnError
but there's nothing wrong with the way you're running it on a query object.Lee
"but there's nothing wrong with the way you're running it on a query object."
Actually, there is because if unexpected errors occur, they will be silent. the dbFailOnError parameter exposes these errors.
"I can see that it executes however the table does not get updated. If I run the query in Access it runs fine. "
Something else is going on here. Yes ... what other code is associate with the line you posted?
mx
Actually, there is because if unexpected errors occur, they will be silent. the dbFailOnError parameter exposes these errors.
"I can see that it executes however the table does not get updated. If I run the query in Access it runs fine. "
Something else is going on here. Yes ... what other code is associate with the line you posted?
mx
mx, I agree with your recommendation for the dbFailOnError option in your first post. I use it every time I use db.Execute. My comment "but there's nothing wrong with the way you're running it on a query object." was specifically addressing the Asker's use of db.Execute vs some other query execution method.
Lee
Lee
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No waste of time. :-) All Q prod me to try and test problems and solutions I might not otherwise encounter in my own projects.
About the points
You solved it yourself. There should be an option for that.
Lee
About the points
You solved it yourself. There should be an option for that.
Lee
no waste of time here.
mx
mx
ASKER
The question should have never been asked. It was suggested that I handle the question this way.
db.Execute "qraBOLPreArch", dbFailOnError
mx