<p>I was just writing some quick code and noticed this complier error </p>

<blockquote>
  <p>Using the iteration variable in a lambda expression may have unexpected results.<br>
  Instead, create a local variable within the loop and assign it the value of the iteration variable.</p>
</blockquote>

<p>I know what it means and I can easily fix it, not a big deal.<br>
But I was wondering why it is a bad idea to use a iteration variable  in a lambda?<br>
What problems can I cause later on?</p>

Assuming you mean C# here.
It's because of the way the compiler implements closures. Using an iteration variable
can
cause a problem with accessing a modified closure (note that I said 'can' not 'will' cause a problem because sometimes it doesn't happen depending on what else is in the method, and sometimes you actually want to access the modified closure).
More info:
http://blogs.msdn.com/abhinaba/archive/2005/10/18/482180.aspx
Even more info:
http://blogs.msdn.com/oldnewthing/archive/2006/08/02/686456.aspx
http://blogs.msdn.com/oldnewthing/archive/2006/08/03/687529.aspx
http://blogs.msdn.com/oldnewthing/archive/2006/08/04/688527.aspx