If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Wrong message with cascading deletes
Thanks. That's a good idea.
Lars "Douglas J. Steele" schreef in bericht ... FWIW, I usually go one step further, Lars, and calculate the number of records that will be deleted (using DCount). -- Doug Steele, Microsoft Access MVP http://www.AccessMVP.com/djsteele Co-author: Access 2010 Solutions, published by Wiley (no e-mails, please!) "Lars Brownies" wrote in message ... It seems like your main concern is the lousy message you get when you're cascadingly deleting. I agree. For some relationships I wouldn't want cascading deletes because it's too risky, but for other relationships I think the built in cascading deletion can come in handy. I'm thinking of replacing the default message by something like: Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer) Response = acDataErrContinue If MsgBox("Warning!" & vbCrLf & vbCrLf & _ "Deleting this record will also delete " & _ "the related records in the Activity table." & vbCrLf & vbCrLf & _ "Are you sure you want to continue?", _ vbOKCancel + vbExclamation + vbDefaultButton2) = vbCancel Then Cancel = True End If End Sub Lars "Tony Toews [MVP]" schreef in bericht ... "Lars Brownies" wrote: A2003: Table Person linked 1 X M to table Activity. The relationship has its Referential Integrity checkbox and the Cascade Delete checkbox both checked. I have an intense dislike for cascade deletes in Microsoft Access. And I don't like cascade updates. http://www.granite.ab.ca/access/cascadeupdatedelete.htm Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ For a convenient utility to keep your users FEs and other files updated see http://www.autofeupdater.com/ Granite Fleet Manager http://www.granitefleet.com/ |
#12
|
|||
|
|||
Wrong message with cascading deletes
"Tony Toews [MVP]" wrote in
: I have an intense dislike for cascade deletes in Microsoft Access. I don't see it as any different than a trigger. I use it sparingly, though, as in most cases, I want to prevent the deletion of any parent record with children. And I don't like cascade updates. They are appropriate where they are appropriate. This would exclude all Autonumber foreign keys, of course, though Access tends to default to that, anyway. I don't see how "intense dislike" is an appropriate response to these features of a database engine. You use them where they are appropriate and don't use them where they are not. What's to get upset about? I see no reason to dogmatically avoid either or both in all cases. -- David W. Fenton http://www.dfenton.com/ usenet at dfenton dot com http://www.dfenton.com/DFA/ |
#13
|
|||
|
|||
Wrong message with cascading deletes
"David W. Fenton" wrote:
I have an intense dislike for cascade deletes in Microsoft Access. I don't see it as any different than a trigger. I use it sparingly, though, as in most cases, I want to prevent the deletion of any parent record with children. And I don't like cascade updates. They are appropriate where they are appropriate. This would exclude all Autonumber foreign keys, of course, though Access tends to default to that, anyway. I don't see how "intense dislike" is an appropriate response to these features of a database engine. You use them where they are appropriate and don't use them where they are not. What's to get upset about? I see no reason to dogmatically avoid either or both in all cases. Then we agree to disagree. smile Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ For a convenient utility to keep your users FEs and other files updated see http://www.autofeupdater.com/ Granite Fleet Manager http://www.granitefleet.com/ |
#14
|
|||
|
|||
Wrong message with cascading deletes
"Lars Brownies" wrote:
It seems like your main concern is the lousy message you get when you're cascadingly deleting. I agree. Yes, that's one reason as the user won't understand the ramifications or even notice the extra words in the message. However I seldom allow the users to delete records anyhow. I usually make the parent records inactive or such. I like keeping history around. Now when entering transaction data such as invoice details for an invoice which will be canceled then sure. But that's fairly seldom and I don't mind spending the extra minute or two doing the coding. This also, ahem, saves on developer error too. Not that I've ever had that happen to me. smile whistling and looking around Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ For a convenient utility to keep your users FEs and other files updated see http://www.autofeupdater.com/ Granite Fleet Manager http://www.granitefleet.com/ |
|
Thread Tools | |
Display Modes | |
|
|