JWColby
jwcolby at colbyconsulting.com
Wed Mar 14 06:55:56 CDT 2007
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