Saphirah
Active member
- Local time
- Today, 12:16
- Joined
- Apr 5, 2020
- Messages
- 163
Hey everyone,
we all know that little message that pops up when you want to delete a record, but the record is connected/in a relationship with another existing record.
"The record cannot be deleted or changed, because table X includes related records".
Now for this i imagine access doing some checks, and these are usually really fast.
I have a table X with records, and i want to the user be able to press a button to delete this record in a form. Once in a while there is the popup message refered above.
Now my boss gave me the task to hide this button, whenever the record is not deletable.
Is there any way in vba to easily check if there is a related record using my current record? I do not want to use DCount or similar, because the Database may change in the future and i do not want to hardcode this, so there are not any problems in the future
Thank you very much
we all know that little message that pops up when you want to delete a record, but the record is connected/in a relationship with another existing record.
"The record cannot be deleted or changed, because table X includes related records".
Now for this i imagine access doing some checks, and these are usually really fast.
I have a table X with records, and i want to the user be able to press a button to delete this record in a form. Once in a while there is the popup message refered above.
Now my boss gave me the task to hide this button, whenever the record is not deletable.
Is there any way in vba to easily check if there is a related record using my current record? I do not want to use DCount or similar, because the Database may change in the future and i do not want to hardcode this, so there are not any problems in the future
Thank you very much