if (tabControl1.SelectedTab == ItemStock)
{ if (keyData == Keys.Enter || keyData==Keys.Tab)
{
just switch this two if condition.i guess it will work
<pre> // Check if Enter is pressed
if (keyData == Keys.Enter || keyData==Keys.Tab)
{
if (tabControl1.SelectedTab == ItemStock)
{
</pre>