How to populate a drop down field with data from last two records fetched from another form

How to populate a drop down field with data from last two records fetched from another form

I just don't know why this does not work. I'm fetching all the records from form "Received_Ingredient" in which the "Grains" field is "Rye". I want to populate a drop down field, "Rye_Lot_Number" with the "Lot_Number" in the latest two records. I think the last two records will be the first to be fetched, but if not I can sort by a date field in each record.
This won't compile without error.

count=0;
for each delivery in Received_Ingredient[Grains="Rye"];
{
  if(count<2)
    {
       count=count+1;
       Rye_Lot_Number:ui.add(delivery.Lot_Number);
    }
}
What the heck am I missing?

Barry