Drew Wutka
DWUTKA at Marlow.com
Fri May 16 11:27:41 CDT 2008
Do you realize that you are creating an instance of this class for each callback? No wonder it's sluggish! (To check, but a debug statement into your initialize event). Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, May 16, 2008 11:16 AM To: Access Developers discussion and problem solving Subject: [AccessD] cbo Callback - method Drew, The code is a function cboCallback(typical params here) calling a method of a class. The callback function (module): Option Compare Database Option Explicit Const cstrModule As String = "basCallback" Private mdb As DAO.Database Private mclsCallback As clsCallBack Function cboCallBack(control As control, ID As Variant, _ row As Variant, column As Variant, _ code As Variant) As Variant On Error GoTo Err_cboCallBack If code = acLBGetFormat Then cboCallBack = -1 Exit Function End If ' 'checks if the class is initialized If mclsCallback Is Nothing Then Set mclsCallback = New clsCallBack If mdb Is Nothing Then Set mdb = CurrentDb End If End If ' 'Calls the callback method of the class cboCallBack = mclsCallback.mCallBack(control, ID, row, column, code) Exit_cboCallBack: On Error Resume Next Exit Function Err_cboCallBack: LogErr Err.Number, Err.Description, Erl, cstrModule, "" Resume Exit_cboCallBack Resume 0 '.FOR TROUBLESHOOTING End Function > That shouldn't matter John, please post the code for your callback > function. John W. Colby www.ColbyConsulting.com Drew Wutka wrote: > That shouldn't matter John, please post the code for your callback > function. > > I've had large listboxes which are callback based too, which work fine. > > Drew -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited.