Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

reference recordsource on subform Expand / Collapse
Author
Message
Posted Thursday, April 10, 2014 6:51 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, July 11, 2014 1:51 PM
Points: 100, Visits: 788
Thank you again
what calls the Public Property Get Ready()?
Is the process of setting
m_booReady = True
in the main form Open event
enough to call it?
Post #1560401
Posted Thursday, April 10, 2014 7:31 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Yesterday @ 4:28 PM
Points: 84, Visits: 1,015
m_booReady is what's usually called a member variable, meaning that:
1. It is declared outside any procedure in the module.
2. It is declared as Private.
The consequence is that such a variable is available from any procedure in the module where it is declared but cannot be accessed from outside this module.

The Ready property acts as an interface to provide the value of m_booReady to any procedure calling from outside the module of the parent form. It is called by the Form_Current event handler of SF1. Is the Ready property returns True, that means that the Form_Open event handler of the parent form has been executed, which cannot occur before all subforms (SF and SF2) are initialized.

That way, we know whether SF1.Form_Current can address the RecordSource property of SF2 or not. If Parent.Ready is False, that mean that SF2 probably is not loaded yet (or at least that the whole compound Parent + Subforms is not totally initialized). In such a case, we store the SQL string that must be used as the RecordSource for SF2 into another property of the parent: SQL.

When the Form_Open event handler of the parent will be processed, this SQL string (stored in the member variable m_strSQL in the parent form) will be sent to SF2. Without that precaution, SF2 would be left uninitialized (i.e. blank RecordSource) when the form is open and will only receive its RecordSource property when the next Form_Current event occurs for the parent form.

Have a nice day!
Post #1560423
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse