I am creating a childrens program where the user has an opportunity to change their password or delete an account. The information is inside a text file and i don't know how to delete only the password etc... At the moment my code is:Nothing is working!!!vb Code:
Public Function ChangePassword_Click(ByVal password As String, ByVal start As Integer, ByVal length As Integer, ByVal studentpass2 As String) As String studentpass1 = InputBox("Please enter your previous password.") studentpass2 = InputBox("Please enter your new password.") If start + length >= Len(password) Then DeleteSubString = Left(password, start - 1) Else DeleteSubString = Left(password, start) & Mid(password, start + length + 1) End If InsertSubString = Left(password, start - 1) & studentpass2 & Mid(password, start) MsgBox ("You have successfully changed your password"), vbExclamation End Function I have also tried this: Private Sub cmdchangepassword( ) Click Function (byVal username as String, ByVal password as String, ByVal studentpass1 as String, ByVal studentpass2 as String) as String Replace (password, studentpass1, studentpass2 End Function




Reply With Quote