I have not used InfoPath 2007 yet but I am sure the concept is the same; You
will need to call the secondary data connection from script (or managed code)
using the node content of the selected index of your drop down (which is tied
to an underlying XMLDOMNode)
This link explains how to do it:
http://support.microsoft.com/kb/826994
If your form is managed code then this link explains how to do it in C#
http://aspalliance.com/498
The key is the IXMLDOMDocument3 object. Just make sure you provide yu
secondary data source with parameter values and you should be good to go.
Hope this helps.
> Hello Everyone,
> New to Infopath and using infopath 2007. I would like to know how to
[quoted text clipped - 9 lines]
> Thanks,
> Erin
esebastian@esolutionsgroup.ca - 12 Apr 2007 14:03 GMT
Thanks so much for your response psiEnergos. Here is the code i used
to make this happen..
Ok i've figured this out.. here's how i've done this in infopath 2007.
if ( e.NewValue != "" )
{
DataConnection objADOAdapter;
AdoQueryConnection connection;
objADOAdapter = this.DataSources["NavigationGroups"].QueryConnection;
connection = ( (AdoQueryConnection)( objADOAdapter ) );
// Retrieve the field in the InfoPath form whose value will be used in
the WHERE clause
XPathNavigator node = this.CreateNavigator().SelectSingleNode( "/
my:myFields/my:group10/
my:cbIdentifyAssetFilterTypes",this.NamespaceManager );
if(connection.Command.Contains("inner join"))
{
//i want to remove the inner join text if there is already an inner //
join so that i can append the new join condition.
int index = connection.Command.IndexOf( "inner" );
connection.Command = connection.Command.Remove(index );
}
// Generate the new SQL statement with the INNER JOIN and WHERE clause
string strSQL = connection.Command + " inner join
linker_parent_to_child_nav l on l.childid = NavigationGroups.id where
parentid = '" + node.InnerXml + "'";
connection.Command = strSQL;
this.DataConnections["NavigationGroups"].Execute( );
}