chris at thecube.net
chris at thecube.net
Tue Jan 13 05:08:06 CST 2004
John, Thanks for the 'warm' response <g>. I think i will get on and write the checkbox class to handle all of the checkboxes, on the subject of WithEvents/DEEP, do you have a lot of variants for say textboxes or do you prefer to add parameters at runtime to sink different events / control behaiviour? Cheers John Chris ----- Original Message ----- From: John W. Colby To: "Access Developers discussion and problem solving"<accessd at databaseadvisors.com> Sent: Tue, 13 Jan 2004 05:39:56 -0500 Subject: RE: [AccessD] =function() in .onclick I can't help you as to why it sometimes works and others it doesn't. However I'd like to say I HATE it when developers do this (and I have to maintain it). I routinely use the find dialog to find instances of code. Doing it like that means that I have to use a find and replace utility instead which is much more intrusive to my development effort. Another thing is that if you ever intend to use Withevents, they don't fire unless the words [Event Procedure] are in the property. If you have an event stub, you can use withevents (sink the event in a class) and the event handler in the form at the same time - the event handler in the class simply gets control first. Doing it with the function call in the property prevents sinking that control's events anywhere else. Now... If you ever handed that application off to someone like myself (who uses withevents), I build a class that directly pokes the words [Event Procedure] into the control's event property (to make sure the event fires) and now MY class works but your functionality abruptly ceases to work. Just thought I'd throw that out there. If I were you I'd probably write a class that handles those checkboxes, either individually or en mass. John W. Colby www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of chris at thecube.net Sent: Tuesday, January 13, 2004 5:24 AM To: accessd at databaseadvisors.com Subject: [AccessD] =function() in .onclick Hi All, Instead of writing 54 event procedures, i simply iterate through a collection of checkboxes and set their AfterUpdate property to a function like so: for index = 1 to 54 me("chkTemplate" & index).Afterupdate = "=toggleTemplate(" & index & ")" next now, on some Access 2000 installs this works fine, yet on others it baulks at trying to put a function straight into the event like above. Am I doing anything wrong? Cheers Chris _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com