Question Edit Error Message

Hollis

Registered User.
Local time
Tomorrow, 07:44
Joined
Nov 20, 2008
Messages
13
Hi All,

I have a many to many relationship set up with my tables and as I know when you try to deleate a record that is in anouther table it comes up with this error message:

Code:
The record can not be deleated or changed becasue the table 'tablename' includes related records.

So I was wondering if I am able to change what this error message says so that it can be more user friendly (as I know some of the people using this database are not that access savy and so wouldn't know what this error message is trying to tell them).

Thanks
 
Normally, that would be managed by forms and you can explicitly disallow deletions within forms if so necessary.

I sure hope you're not letting the users work with the tables directly.
 
This error message comes up when you press a deleate button on the form that I have set up using the wizard.

So is there anyway I can change what that error mesage says?

Or do I need to write some code to deleate the related records in the other table?
 
If you could post the code for that button, we could provide suggestions as this more or less depend on exactly how you are doing it.
 
Yup sure. Here is the code:

Code:
Private Sub Command29_Click()
On Error GoTo Err_Command29_Click
 
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_Command29_Click:
Exit Sub
Err_Command29_Click:
MsgBox Err.Description
Resume Exit_Command29_Click
 
End Sub

Looking at that code, will I just need to change the Err.Description?
 
Yes, that's correct; the minimum you can do is to change this line:

Code:
Msgbox Err.Description"

to

Code:
Msgbox "OMGZ! It's the end of world as we know it!"
 
Haha, I better not put that there, might freak some people out.

Well that's fairly pain less, thanks for your help Banana :D
 

Users who are viewing this thread

Back
Top Bottom