Hi Hilary, Yes you are correct in your first statement. I do not have a formula on my field. I am populating the dropdown from a stored procedure with C#. On a load or change event I run some code to open the ds, query the data, close the connection and build the data table using this post as an example
http://www.bizsupportonline.net/infopath2007/programmatically-fill-populate-drop-down-list-box-infopath-2007.htm
Actually the dropdown is using a resource file that is a simple xml. the code behind does all the work. the problem with the post is it wasnt using this code in a repeating section, other wise it works perfectly.
so now I am at an empass. this code populates my first ddl
public void CmdtyGroup()
{
string DSName = "Group_AgreementLineItems"; // the XML resource file name
string xpathReg = "/my:myFields/my:myHeader/my:Header/my:Region";
string xpathRN = "/my:myFields/my:myLineItems/my:CmdtySect/my:Commodity/my:RegionName";
XPathNavigator Region = MainDataSource.CreateNavigator().SelectSingleNode(xpathReg, NamespaceManager);
XPathNavigator RegionName = this.MainDataSource.CreateNavigator().SelectSingleNode(xpathRN, this.NamespaceManager);
try
{
//Multiple Rows Expected
DataTable MyData = GetDataTable("EXEC Get_CPMSD_CommodityGroup '" + RegionName + "'", "Get_CPMSD_CommodityGroup");
if (MyData != null)
{
ClearItems(DSName);
AddItems(DSName, MyData.Rows, "CommodityGroup");
}
}
catch (Exception ex)
{
string log = ex.Message;
throw new Exception(ex.Message);
}
}
this code populate the second ddl where I an having the problems and uses the value from the previous selection
public void CmdtySubGroup()
{
string DSName = "SubGroup_AgreementLineItems";
string xpathCG = "/my:myFields/my:myLineItems/my:CmdtySect/my:Commodity/my:CmdtyGroup"; //"my:CmdtyGroup";
XPathNavigator Cmdty = this.MainDataSource.CreateNavigator().SelectSingleNode(xpathCG, this.NamespaceManager);
try
{
//Multiple Rows Expected
DataTable MyData = GetDataTable("EXEC Get_CPMSD_CommoditySubGroup '" + Cmdty + "'", "Get_CPMSD_CommoditySubGroup");
if (MyData != null)
{
ClearItems(DSName);
AddItems(DSName, MyData.Rows, "CommoditySubGroup");
}
}
catch (Exception ex)
{
string log = ex.Message;
throw new Exception(ex.Message);
}
}
do you need any more info?