Erwin Craps
Erwin.Craps at ithelps.be
Mon Jul 21 03:59:00 CDT 2003
I personaly never use openargs...(anymore) I believe they are from an old generation Access and they have a shortcoming on the length... (2000 something or is it 256 something.) Two ways to solve this... Use a class property in your form. Or set a form.control from where you call the code and then run a public declared function in your form. The class has my preference. I found myself dabble around with these openargs, etc until I discovered classes in and out forms. I felt in love with classess, but they do tend to generate more work in the beginning. Erwin -----Oorspronkelijk bericht----- Van: David Emerson [mailto:davide at dalyn.co.nz] Verzonden: maandag 21 juli 2003 3:04 Aan: dba-SQLServer at databaseadvisors.com; ACCESS-L at PEACH.EASE.LSOFT.COM; accessd at databaseadvisors.com Onderwerp: [AccessD] Recordsource running before Open Event Groups, I have the following code in the Open event of a form - If Me.OpenArgs <> "All" Then Me.InputParameters = Me.OpenArgs <- Form_Current event triggers here Me.RecordSource = "spfrmGeneralJournal" Else Me.RecordSource = "spfrmGeneralJournal" End If The problem is that the "Me.InputParameters = Me.OpenArgs" triggers the Form's Current event. This is a problem because in there it checks for the value of a field and because the Recordsource hasn't been defined yet it generates an error. The reason that the record source is not defined until in the Open Event is because the front end is linked to an SQL B/E and the table that is the source has over 55,000 records which is taking over 5 seconds to open. This is opened, then the Open event is fired to produce the reduced record set (in effect the sproc is being run twice). Does anyone have a method for opening the form without the Current event being triggered before the open event is completed? (Or preventing the sproc being run before the Open event is processed)? Regards David Emerson DALYN Software Ltd 25b Cunliffe St, Johnsonville Wellington, New Zealand Ph/Fax (877) 456-1205 _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com