jwcolby
jwcolby at colbyconsulting.com
Wed Mar 5 11:58:22 CST 2008
Hmm.... A form's module is just a class. I have a class for every combo with the combo passed in. If I could place the callback inside of that class... but... I could swear that the combo had to have a public FUNCTION as the callback, IOW as the combo loaded it tried to "call" the function and the function had to be in a public module, not a class. I must admit that I never tried to do this inside of my class however. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, March 05, 2008 12:45 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] using ADO to populate combos -was RE:Error3048Cannotopen any more databases Hi John I think you are right. What I have done is to make the callback function private and copy it into the module of the form - I've never had more than a couple of these for one form. But I realize that this doesn't play well with your framework. /gustav >>> jwcolby at colbyconsulting.com 05-03-2008 17:28 >>> Have you ever done this? Inside of the call back function was a static array where the data for that specific control was placed. Thus each callback was specific to the control passed in. I tried doing this and failed. Do you have code demonstrating what you are thinking about? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, March 05, 2008 11:12 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] using ADO to populate combos - was RE:Error3048Cannotopen any more databases That's not necessary, to write a function for each control. One of the arguments of that control is the control itself. So you could create one function, in a module, that would be your 'global' callback function. What I would recommend would be to create a class that would handle recordset objects, and in your callback function pull the appropriate recordset from that class based on the control argument that is passed to the callback function. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, March 05, 2008 9:17 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] using ADO to populate combos - was RE: Error3048Cannotopen any more databases Long ago I tried using call back functions and the only way I could figure out to do it was write a callback for each object. That just doesn't work when you want to implement this easily and automatically system wide - five hundred different combos. John W. Colby Colby Consulting www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com