|You should not assign value to a variable in the Dim Statements|
You Dim the variables and then assign the values. What you are trying to do can only be one with constants.
However in this instance is is unnecessary. Counter will get the value of 0 every time the code runs and pass will default to false.
You should try re-writing the code so that if the user enters the correct password, pass is assigned True and test on that. Would make it a lot simpler. Testing an a default value is always fraught with problems.
You should never end a VB application with End. IIt will not terminate the application properly and will lead to memory leaks. End is only there for backward compatibility with earlier versions of VB.
In this instance, I take it the txtPassword.Text is on a form. To terminate the application, close the form. When the application reaches the end of the code in the current function, it will end. Using End and the form remains in memory taking up space