End of Statement Expected?

Messages
8,474
Location
Australia
Ok,here is the part of the code i need help with:

Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
Dim FileToCopy As String
Dim NewCopy As String

FileToCopy = Form1.add.FileName
NewCopy = "C:\" + TextBox1.Text + ".ink"
If System.IO.File.Exists("C:\" + TextBox1.Text + ".ink") = True Then MsgBox("File Already Exist's")


If System.IO.File.Exists(FileToCopy) = True Then
System.IO.File.Copy(FileToCopy, NewCopy)




MsgBox("Shortcut Added")
Me.Close()
End If

End Sub

If you notice on line 8,if a file already exists with the same name,a message box appears,but the script continues,how can i make this text make that message box appear,THEN allow the user to re-enter a name?
 
I haven't messed with VB in a while, but I think you can make another message box pop up (I believe it's called an input box) and you can extract information from there. Also, to make this go on until the names don't match you can do a while loop if you know what those are.
 
Back
Top Bottom