Custom Error messages not being displayed?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Would appreciate any insight into this one.
I have a sub from that allows the entry of some data. The table that it is
built on is an ODBC linked SQL server table.
The sub form allows the the entry of two foriegn keys in the above mentioned
table. There is a contstraint on the
table that stops a duplicate (FK1 & FK2) pair to be entered. When I attempt
to enter a new record with duplicate foriegn
key pair Access will not let me move off the record. No code in the
Form_Error procedure of the sub for is executed.
This makes feed back to the user a bit difficult because they don't know
about the constraint.
The only thing I can think of is that I have not set a property enabling
errors?
Many Thanks
Terry.
 
I think that I might have some extra insight into this issue.
If re-import the table that has these two foreign keys as data (FK1 & FK2)
and
then try to break the constraint (FK1 & FK2 on this table must be unique) then
I get a data error. That is a big message box pops up with the error number
and
ODBC error information on what constraint I am violating. After closing the
table
and trying again I get no data error??? I have tried to import the table again
and I still get no error message. This behaviour seems to be a bit erratic. So
I have ruled out the fact that it might be something to do with the placement
of this table on a sub form.
Any ideas?
Thanks
Terry.
 
Back
Top