f lParam = 135200769 Or lParam = 1208942593 Or lParam = 983041 Or
      1074724865 Then
      If frmNew.SetBackwardFocus Then
       TabKeyProc = 1&amp;: Exit Function
      End If
     End If

    ElseIf GetKeyState(VK_TAB) &lt; 0 Then
     If lParam = 135200769 Or lParam = 1208942593 Or lParam = 983041 Or
      1074724865 Then
      If frmNew.SetForwardFocus Then
       TabKeyProc = 1&amp;: Exit Function
      End If
     End If
    
    End If
   
   End If
  
  ElseIf wParam = 13 Then
   If frmNew.IsNew