Gustav Brock
Gustav at cactus.dk
Thu Feb 22 11:02:34 CST 2007
Hi Rocky No, that is not possible - and it was a major drawback in Access 1.x which didn't have code-behind-form modules. What you are asking for is WithEvents. Shamil and JC have posted repeatedly on this subject and I believe an article is on the dba site. /gustav >>> rockysmolin at bchacc.com 22-02-2007 17:48:44 >>> >From a colleague. Any ideas on this? TIA Rocky _____ From: Mike Dwyer [mailto:mike at aesadvantage.net] Sent: Thursday, February 22, 2007 12:13 AM To: bheygood at abestsystems.com; Dixon; Barry Hynum; Bob_Heygood; Doug Murphy; Ed Lance; Jackie Murphy; JKA Joe K Anderson; Rocky Smolin Subject: Basic Question Ok, this is Access 101 but I must be having a mental moment. If I use a function instead of an event procedure for BeforeUpdate, can that function return a value that cancels the update? I have a form with 120 fields on it (lots of tabs). I don't want 120 event procedures for each BeforeUpdate and I don't want 120 event procedures for AfterUpdate. I would like to select all 120 fields and set the BeforeUpdate property to something like =BeforeUpdate(). This works great for AfterUpdate, however, when I set it for the BeforeUpdate property, returning a value from this function doesn't cancel the edit. Is this possible?