Stop deleting one record

pekajo

Registered User.
Local time
Tomorrow, 08:28
Joined
Jul 25, 2011
Messages
135
Hi,
I have an application that has one record that when clicked will ask for more information.
Is there a way where just this one record (table has primary ID) cannot be deleted as I cannot not see how I could use an if statement.
Thanks
Peter
 
bring your table in design view.
add Data Macro (Before Delete):

If True Then
RaiseError

Error Number: 5000
Error Description: Deletion not allowed
End If
 
Is this a one record table. If so, you could change the table's attributes to make it read only
 
Hi,
I have an application that has one record that when clicked will ask for more information.
Is there a way where just this one record (table has primary ID) cannot be deleted as I cannot not see how I could use an if statement.
Thanks
Peter
Hi Peter. Here's one other option for you to consider.

You can create a "secret/hidden" table and add a foreign key to it for that "precious" record you want to keep in your table.

Just a thought...

Edit: I just realized the child table can't be too secret since the error message mentions it by name. :)
 
Last edited:

Users who are viewing this thread

Back
Top Bottom