<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>But I can't set the "source object" property of the
second subform at this time since it is not yet loaded.</FONT></DIV>
<DIV><FONT face=Arial size=2>Attempting to reference this 2nd subform will
generate an error.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm using this piece of code.</FONT></DIV>
<DIV><FONT face=Arial size=2>The main form is frmHistoMaint</FONT></DIV>
<DIV><FONT face=Arial size=2>The second subform is:
sfrHistoMaintComment</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Private Sub Form_Current()<BR>'synchronisation de
la zone de commentaire<BR>Dim lHistoMaintId As Long<BR>If Not
IsNull(Me.HistoMaintId) Then<BR> lHistoMaintId =
Me.HistoMaintId<BR> 'an error occurs
when sfrHistoMaintComment is not yet loaded<BR> 'On Error
Resume Next<BR>
Form_frmHistoMaint.sfrHistoMaintComment.Form.SourceObject =
"sfrHistoMaintComment"<BR>
Form_frmHistoMaint.sfrHistoMaintComment.Form.Filter = "[HistoMaintId]=" &
lHistoMaintId<BR>
Form_frmHistoMaint.sfrHistoMaintComment.Form.FilterOn = True<BR>ElseIf
IsNull(Me.HistoMaintId) Then 'This is to have a blank form when no record are
selected in the 1st subform<BR>
Form_frmHistoMaint.sfrHistoMaintComment.Form.Filter = "[HistoMaintId]=" &
0<BR> Form_frmHistoMaint.sfrHistoMaintComment.Form.FilterOn =
True<BR> <BR>End If<BR>End Sub</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thank's for your answer,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Philippe</FONT></DIV>
<DIV><FONT face=Arial size=2> </DIV>
<DIV><BR></DIV></FONT>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=jcolby@colbyconsulting.com
href="mailto:jcolby@colbyconsulting.com">John Colby</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=accessd@databaseadvisors.com
href="mailto:accessd@databaseadvisors.com">accessd@databaseadvisors.com</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, June 05, 2003 5:36
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [AccessD] How to control
subforms loading order?</DIV>
<DIV><BR></DIV>
<DIV><SPAN class=109113515-05062003><FONT face=Arial color=#0000ff size=2>Yep,
JIT loading. The control on the form has a "source object"
property. Simply set this property for the second subform to nothing,
then after the first subform loads, set the property of the second
subform.</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<P><FONT size=2>John W. Colby<BR><A
href="http://www.colbyconsulting.com">www.colbyconsulting.com</A></FONT> </P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> <A
href="mailto:accessd-bounces@databaseadvisors.com">accessd-bounces@databaseadvisors.com</A>
[mailto:accessd-bounces@databaseadvisors.com]<B>On Behalf Of </B>Philippe
PONS<BR><B>Sent:</B> Thursday, June 05, 2003 11:19 AM<BR><B>To:</B>
AccessD@databaseadvisors.com<BR><B>Subject:</B> [AccessD] How to control
subforms loading order?<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have a form with two embedded
subforms.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>On the OnCurrent event of the first
subform, I synchronise the second one using the Filter and OnFilter
properties of it.</FONT></DIV>
<DIV><FONT face=Arial size=2>This works fine, but generates an error the
first time the Form is loaded.</FONT></DIV>
<DIV><FONT face=Arial size=2>This is because I reference the second subform,
but at this time it is not yet loaded.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>I found a workaround by removing the first
subform from the main form and reinserting it, as it seems Access loads the
subforms in the same order at which they have been inserted.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>However, I would like to have a more robust way
of controling the loading order.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Do you have a better solution?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks in advance,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Philippe.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BLOCKQUOTE>
<P>
<HR>
<P></P>_______________________________________________<BR>AccessD mailing
list<BR>AccessD@databaseadvisors.com<BR>http://databaseadvisors.com/mailman/listinfo/accessd<BR>Website:
http://www.databaseadvisors.com<BR></BLOCKQUOTE></BODY></HTML>