Delete record only if child records don't exist

sponge

Registered User.
Local time
Today, 05:46
Joined
Jul 12, 2005
Messages
44
Hi,

I'm trying to have a button on a form that would delete a record from a table only if there are no child records linked to it.

If there are child records for the selected record, the button would be disabled.

Is there a simple way of doing this?

TIA.
 
Referential Integrety does this for you. You could trap error 3200 and give your own message. As far as disabling the delete button, this does not assist in that endeavor.
 
Showing a customized message box would suffice :)

One msgbox pops up when deleting a record that does not have child records linked - "You are about to delete 1 row(1) from the specified table"

I'd like to change this msg and when there are linked records, a key violation msgbox pops up afterwards.

Is it possible to have the customized msgbox popup when you are allowed to delete and another msgbox popup when there are child records linked?
 
I tend to let the user do whatever they choose and tell them when that can't be accomplished and why. It sounds like you wish the user to spend quite a bit of time clicking on message boxes that tell them what they can and can't do. I'm sure someone here can help you with that task.
 

Users who are viewing this thread

Back
Top Bottom