What is User32? Is it a control on one of these forms? Also, you are setting Form2.Visible = False on both sides of the If/Else statement.