SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


reference recordsource on subform


reference recordsource on subform

Author
Message
grovelli-262555
grovelli-262555
SSC Veteran
SSC Veteran (251 reputation)SSC Veteran (251 reputation)SSC Veteran (251 reputation)SSC Veteran (251 reputation)SSC Veteran (251 reputation)SSC Veteran (251 reputation)SSC Veteran (251 reputation)SSC Veteran (251 reputation)

Group: General Forum Members
Points: 251 Visits: 885
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?
rf44
rf44
SSC-Enthusiastic
SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)SSC-Enthusiastic (135 reputation)

Group: General Forum Members
Points: 135 Visits: 1093
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!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search