directormac
Occasional Presence
- Local time
- Today, 03:21
- Joined
- Oct 24, 2001
- Messages
- 259
There is only one case where I use the BeforeUpdate event of a control and that is if I want to stop the user early in a long data entry process. For example, if SSN is a required field and it must be unique, then I add a BeforeUpdate procedure to ensure the SSN is unique so I can give the user a heads up that he isn't going to be able to actually save the record if the SSN isn't present or isn't unique.
@Pat Hartman : question on best practice, only tangentially related. In the above example, if ALL you needed to do was make sure the value for a given field is unique, is there a benefit to using a custom code in the BeforeUpdate (or even the form level ValidationRule property) vs. setting that field to Indexed / NoDuplicates at the table level? I recall that indexing comes with a performance cost... but if you don't need the scale of 100k or even 10k records, is that overhead acceptable? (still working SLOWLY on the "animals" project, the EAV tips were VERY helpful...)