Related Records Message

Taff

Registered User.
Local time
Today, 18:15
Joined
Feb 3, 2004
Messages
158
I have a command button on a form which deletes records.

Not sure if it possible, but was wondering if when the command button is clicked if there are related records to have a custom message box saying it cannot delete the records and telling them to delete the related records first and telling them what table the records are in?

Thanks in Advance All

Anthony
 
You should build some error checking into your command button code, if you don't have it already. This recent post has a basic error checking structure for a function, but it's the same for a sub: current day is day # of this year. What it will do is put a MsgBox on the screen with the error number and error description.

You can adapt that code, so that if a particular error number occurs, to display your custom message.

I've never done this, so I do not know how to figure out the name of the related table in this case. Hopefully, someone else will know.
 
Hi Pat,

I unfortunately i cant allow the Cascade Delete option, as if there are related records they need to be sent to a central database before they can be deleted off the database. So i thought if they tried to delete a record, they would be notified that they need to export the related records first.

Regards


Anthony
 

Users who are viewing this thread

Back
Top Bottom