[dba-SQLServer][AccessD] Recordsource running before Open Event

David Emerson davide at dalyn.co.nz
Sun Jul 20 20:04:28 CDT 2003


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



More information about the dba-SQLServer mailing list