Quantcast
Channel: VBForums - Database Development
Viewing all articles
Browse latest Browse all 2918

Error inserting into an Access field with a validation rule

$
0
0
I'm having an issue inserting data into an Access table in a field that has a validation rule on it. The field is storing a part number in the format of "xxxx-yyyyyy". There is a validation rule of [Like "????-??????"] on the part field.
When I try to insert a part number of "1234-567890" programatically into that field I get an error "System.Data.OleDb.OleDbException: 'One or more values are prohibited by the validation rule 'Like "????-??????"' set for 'table1.part'. Enter a value that the expression for this field can accept.'

If I remove the validation from the field I can then do the insert, but I need to keep the validation rule in place because sometimes the table is updated manually. Does anyone have any idea how I can do the insert with the validation rule in place? Any help would be greatly appreciated. Thanks...

Viewing all articles
Browse latest Browse all 2918

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>