Validation Rule problem (1 Viewer)

KabirPatel

Registered User.
Local time
Today, 17:05
Joined
Nov 16, 2006
Messages
38
Hi,

I have an .adp that makes use of SQL Server 2000.

In one of my tables I have created a check constraint to ensure that all records in a particular column have exactly 9 characters.

i.e.
ALTER TABLE TableA
ADD CONSTRAINT chk_id CHECK (LEN(ColumnID) = 9)

I created a form that is bound to this table.

For the ColumnID field in the form I created a validation rule that checks to see if the length of the entered value is equal to 9.

If a user enters invalid data for ColumnID a message box comes up specifying this - as I would expect.

However, I also get another message box stating that "The value in the field or record violates the validation rule for the record or field.

For example you may have changed a validation rule without verifying whether the existing data matches the new validation rule."

I believe that this message box is popping up due to the constraint in SQL Server 2000. Is there any way to disable this?

Thanks,
Kabir
 

petehilljnr

Registered User.
Local time
Today, 09:05
Joined
Feb 13, 2007
Messages
192
I ~think~ the problem is because the value has already been passed into the record as soon as that control loses the focus.

If there is no other way, I'd suggest creating an unbound textbox and putting a validation on that control, then after updating update the record based on the value in the control, and also On Current, updating the unbound textbox with the value from the record.

Regards,
Pete.
 

Users who are viewing this thread

Top Bottom