Statement Execution Limit Problem

Statement Execution Limit Problem

Hi,
I'm trying to fill some drop down boxes based on a previously entered value, where it has to search through just under 1000 entries.

here is the code:

  1. for each  AT in Asset_Types
    {
    if(input.Asset_Type = AT.Asset_Name)
    {
    for each  AC in AT.Asset_Components
    {
    for each  CT in Component_Types
    {
    if(CT.Item_Name.contains(AC))
    {
    prefix = CT.Component_Code_Prefix;
    for each  comp in Component_Stock
    {
    if(comp.Component_Code.contains(prefix))
    {
    if(i = 0)
    {
    input.Part_1:ui.add(comp.Component_Code);
    }
    else if(i = 1)
    {
    input.Part_2:ui.add(comp.Component_Code);
    }
    else if(i = 2)
    {
    input.Part_3:ui.add(comp.Component_Code);
    }
    else if(i = 3)
    {
    input.Part_4:ui.add(comp.Component_Code);
    }
    else if(i = 4)
    {
    input.Part_5:ui.add(comp.Component_Code);
    }
    }
    }
    }
    }
    i = i + 1;
    }
    }
    }

It is coming up with a 'Number of statement execution limit exceed' error, then only filling in some of the drop down boxes and leaving some empty.

I really appreciate the help.