I posted this at another newsgroup so let me start by apologizing for the
redundency but I am exasperated.
I am using the following code to attenot ti open a recordset and add a new
record to it. I'm using Access2003 and the databases are split ( backend
with data is in different directory front end with all forms etc) Is this a
proper way to open a recordset with a split database? I,m new to ADO. Every
time I run this code (it's behind Onclick event of command button) I receive
an error about Function is not available in expressions in table-level
validation expression. It seems to be failing on the "If Not rs2.EOF" and
"rs2.AddNew" lines.
There are no validations rules or text in the fields of this table. Any
thoughts or maybe a place to look for answers.
Thanks
Dim rs2 As New ADODB.Recordset
rs2.Open "tbl1", CurrentProject.Connection, adOpenDynamic,
adLockOptimistic
If rs2.EOF Then
rs2.AddNew
rs2![Field1] = Forms!frm1!Field1
rs2.Update
End if
Brendan Reynolds - 23 Mar 2005 20:32 GMT
There is nothing wrong with the code you posted. Your problem lies
elsewhere.

Signature
Brendan Reynolds (MVP)
>I posted this at another newsgroup so let me start by apologizing for the
>redundency but I am exasperated.
[quoted text clipped - 22 lines]
> rs2.Update
> End if
Scott McDaniel - 24 Mar 2005 02:41 GMT
Since your error mentions "Table-Level validation", have you checked
tbl1.Field1 to see if there is a validation rule declared on the field that
could be causing this issue?
>I posted this at another newsgroup so let me start by apologizing for the
>redundency but I am exasperated.
[quoted text clipped - 22 lines]
> rs2.Update
> End if
Brendan Reynolds - 24 Mar 2005 10:02 GMT
You say that there are "no validation rules or text in the fields of this
table". But the error message is not talking about a field-level validation
rule, it's talking about a table-level validation rule. You may not be aware
that there is a difference. To check whether there is a table-level
validation rule, open the table in design view and select Properties from
the View menu. These table properties are separate from the field properties
that you see in the bottom left of the table design view, which apply to
individual fields.

Signature
Brendan Reynolds (MVP)
>I posted this at another newsgroup so let me start by apologizing for the
>redundency but I am exasperated.
[quoted text clipped - 22 lines]
> rs2.Update
> End if
Gibson - 24 Mar 2005 20:00 GMT
Thanks for the response and you are correct, I did not know there was a
different until this problem arose. I opened all tables in the backend in
design view and checked the properties of each. None have validations rules
or validation text. I am at a lose as to why this problem is occuring but
it has completely stop distribution of the program. Any help is greatly
appreciated.
Thanks again.
> You say that there are "no validation rules or text in the fields of this
> table". But the error message is not talking about a field-level
[quoted text clipped - 32 lines]
>> rs2.Update
>> End if
Brendan Reynolds - 25 Mar 2005 03:17 GMT
I believe I remember occasionally seeing that message and finding that the
problem was not actually a validation rule, but some other constraint that
prevented the saving of the record. Some things to look for might include
...
Required fields - are there any required fields in the table with no default
values that are not being assigned values when you attempt to update the
record?
Unique indexes - in addition to the field to which you are explicitly
assigning a value, consider default values of other fields. Would any of
these result in an attempt to assign a duplicate value to a field (or
combination of fields) that must be unique?
Referential integrity - would the value you are explicitly assigning, or any
default values that will be implicitly assigned, result in a value in a
foreign key field that does not match any record in the related table?

Signature
Brendan Reynolds (MVP)
> Thanks for the response and you are correct, I did not know there was a
> different until this problem arose. I opened all tables in the backend in
[quoted text clipped - 42 lines]
>>> rs2.Update
>>> End if
russefr - 31 Mar 2005 22:49 GMT
You may want to check the "Allow Zero Length" value in the table design
modeand set it to "YES"
> I posted this at another newsgroup so let me start by apologizing for the
> redundency but I am exasperated.
[quoted text clipped - 19 lines]
> rs2.Update
> End if