That is not VB.NET code at all. It is VB 6. Are you using VB 6 or VB.NET?