Check the return value of each CAST. This looks like the one...


Debug.Print theFlipping