G
Guest
Hey all,
This is kinda interesting, so I thought I'd share and get some input:
By using VBA code on my 2K db, I found I couldn't add a record using
DoCmd.RunSQL because one of the fields to which the SQL was trying to write
was null, and the underlying field on the table had the "Allow Zero Length"
option set to "No". The attempt to write to the db gave me a validation rule
warning when it failed to update the db. This is fine; I adjusted the table
and all is good.
However, this begs a different question. I have a form that has been
successfully writing to the db all along. The command key to enter the info
uses the generic acNewRec command to enter the data; I can successfully enter
a new record through the form whether or not this aformentioned field is
populated.
Is there something about the acNewRec command that doesn't recognize that
particular validation rule? I realize indicating a failure of an established
process to produce a desired result is idiotic, as there is SO much user
error that can occur, but I swear I eliminated all other common traits in
trying to diagnose this, and it really does seem the same record, as a
DoCmd.RunSQL text string, will fail on that single field validation rule,
while succesfully insert using the form.
Thanks in advance,
Paul
This is kinda interesting, so I thought I'd share and get some input:
By using VBA code on my 2K db, I found I couldn't add a record using
DoCmd.RunSQL because one of the fields to which the SQL was trying to write
was null, and the underlying field on the table had the "Allow Zero Length"
option set to "No". The attempt to write to the db gave me a validation rule
warning when it failed to update the db. This is fine; I adjusted the table
and all is good.
However, this begs a different question. I have a form that has been
successfully writing to the db all along. The command key to enter the info
uses the generic acNewRec command to enter the data; I can successfully enter
a new record through the form whether or not this aformentioned field is
populated.
Is there something about the acNewRec command that doesn't recognize that
particular validation rule? I realize indicating a failure of an established
process to produce a desired result is idiotic, as there is SO much user
error that can occur, but I swear I eliminated all other common traits in
trying to diagnose this, and it really does seem the same record, as a
DoCmd.RunSQL text string, will fail on that single field validation rule,
while succesfully insert using the form.
Thanks in advance,
Paul