The most basic registration form , if for example I run this and enter

username1 and password1
then do that again it will display in txt file as

"username1","password1"
"username1","password1"

Is there an If statement I could use?, so if the username exists then exit sub :?


Code:
Dim savefile As Long
savefile = FreeFile()
Open "D:\a.txt" For Append As #savefile
Write #savefile, (Text1.Text); (Text2.Text)
Close #savefile