I dont get any error message unless I enter the duplicate information
straight in to the table or (the linked table). The form appears to
accept the information, but when you look at the table, the change or
new record has not been saved
In answer to your other questions:
It is a bound form and it is happening in an MDB.
I am using Access 2002 (sp3)
the table is a linked table- the database is multiuser so it is split
in to front and back ends.
the SQL of the query underlying the table is
SELECT employeedetails.*, selection.action
FROM ([post details] RIGHT JOIN employeedetails ON [post
details].[post ID] = employeedetails.[post ID]) LEFT JOIN selection
ON employeedetails.[employee ID new] = selection.[employee ID];
The unique index is defined in the employeedetails table and is made
up of surname+forname+NInumber
If you can see any reason for this then I would be grateful.
Dirk Goldgar said:
No, you shouldn't create an event procedure for the form's Error
event; at least, not yet. I'm puzzled, though. In the absence of
any event procedure to handle the event, you should get an error
message if you attempt to create record that duplicates an existing
key in a unique index.
Is this a bound form, so you're just filling in bound controls and
letting Access save the record in the normal way?
Is this happening in an MDB or an ADP?
What version of Access are you using?
Is the table in question a local table or a linked table?
What is the SQL of the query that is the form's recordsource?
If multiple tables are involved in the query, which one has the
unique undex defined on it?
message I have found the onerror property and there is no procedure in here
- should Iput one in? If so, what do I say?
cheers
:
I am entering the data via a form which is based on a select query.
I havent to my knowledge told it to ignore any errors. Where would
I find this property?
:
message I am trying to put a check in to place so that a person cannot be
added to the database more than once. I have created an index
based on forname, surname and NI number and have said this needs
to be unique. Therefore if the user tries to enter someone
twice, then they will not be able to.
This seems to work, however, it dosesnt tell me that it hasnt
added the record. It just doesnt add the record. How do I make
it obvious to the user that the record cannot be added because
it is a duplicate?
Hope this makes sense
What sort of process are you using to add records? If you're
doing it via a form, I'd expect you to get an error message
(unless the error was trapped and ignored in the form's Error
event). If you're executing an append query in code via the DAO
Execute method, you'd need to specify the dbFailOnError option if
you want an error to be raised.