A
Arnaud Lesauvage
Hi all !
I have a strange problem here :
I am inserting data from a linked table into a local table (it is
a table i my frontend, that I use as a temporary storage for
better performances).
I added a validation rule on a field, and it always fail when I
run the INSERT statement from VBA (using connection.execute), but
it works when I run the query manually !
Let me be a little more specific :
First of all, I know that the rule is always valid (with the
actual data). It is very easy to check, and I did so many times.
My code looks like this :
currentproject.connection.execute "INSERT INTO
myTableWithValidation SELECT * FROM myLinkedTable WHERE someField
= something"
This raises the error message that I entered as a failed
validation check message.
If I run the exact same query from query designer, it works !
If I use DoCmd.RunSQL, instead of connection.execute the query works !
I have to use connection.execute though, because this query is
inside a quite large transaction.
What am I doing wrong ?
Thanks for helping !
Arnaud
I have a strange problem here :
I am inserting data from a linked table into a local table (it is
a table i my frontend, that I use as a temporary storage for
better performances).
I added a validation rule on a field, and it always fail when I
run the INSERT statement from VBA (using connection.execute), but
it works when I run the query manually !
Let me be a little more specific :
First of all, I know that the rule is always valid (with the
actual data). It is very easy to check, and I did so many times.
My code looks like this :
currentproject.connection.execute "INSERT INTO
myTableWithValidation SELECT * FROM myLinkedTable WHERE someField
= something"
This raises the error message that I entered as a failed
validation check message.
If I run the exact same query from query designer, it works !
If I use DoCmd.RunSQL, instead of connection.execute the query works !
I have to use connection.execute though, because this query is
inside a quite large transaction.
What am I doing wrong ?
Thanks for helping !
Arnaud