[AccessD] passing info to a subform sourceobject change

Bruce Bruen bbruen at unwired.com.au
Wed Mar 14 15:53:33 CDT 2007


Thanks John! That was the clue I needed.  I couldn't see the forest for the 
treeview, so to speak.

I actually added it as a property to the parent form (F) which now lets me do 
all kinds of nefarious jiggling when things are changed in either the form or 
the subform!  I am even considering the possibility of a user driven morphing 
of monkey-wrench's into grapefruit.

One question (only of interest mainly) ..  Are the OpenArgs <u>only</u> 
available through docmd.Open? Is there any other structure that can set them?


bruce

On Wednesday 14 March 2007 22:55, JWColby wrote:
> It is possible, but not using the OpenArgs AFAIK.  The reason is that
> OpenArgs is passed in the Docmd.Open syntax, which isn't running in this
> case.
>
> You can "pull" a string into the sub form as it opens.  Have the code that
> is manipulating the subform's SourceObject set a public variable in the
> form's header and then when the subform opens, have the form examine
> me.parent.MyVariableName.  That should do it.
>
> John W. Colby
> Colby Consulting
> www.ColbyConsulting.com
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bruce Bruen
> Sent: Wednesday, March 14, 2007 6:46 AM
> To: Access Developers discussion and problem solving
> Subject: [AccessD] passing info to a subform sourceobject change
>
> What i've got is a form F with a subform S that changes freqently.  I mean,
> that, depending on the current row of F  (which defines it's specific type)
> then the form that is used for S changes, i.e. I swap its SourceObject.
>
> So if the current row in F is an "apple", then the subform S shows the
> "subApple" form.  However, if the current F row is a "socket wrench" then S
> shows the "subSWrench" form. ------> This all currently works great.
>
> But now I find that I want to send some important information to some of
> the subforms when I set them.  For example, I may want to send the
> S.variety value to the subApple form or conversely the s.Size value to the
> subSWrench form.
>
> So, having found that changing  F.genericSubForm.SourceObject actually
> fires the new subform's OnOpen event I am trying to work out how to use
> it's OpenArgs() to pass the data.
>
> Is this possible?  Am I barking mad?  Has anyone got any ideas?
>
> or should I grab my Terry Jacks' albums and just move to suvern kelifornya?
>
>
> --
> regards
>
> Bruce
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com

-- 
regards

Bruce



More information about the AccessD mailing list