title: Change Password Delphi v7
body: <p>Delphi v7</p>
  
  <p>This code is designed to allow the user to change his password. It appears to execute correctly, but the new password is not saved in the the password data field. I must have done something wrong, but I cannot see it.</p>
  
  <pre><code>procedure TForm4.btnPswordClick(Sender: TObject);
  var
    I: integer;
  begin
  tblLogin.First;;
  for I := 0 to tblLogin.RecordCount  do
  Begin
  If tblLogin.FieldByName('Username').Value = Edit1.Text then
  if tblLogin.FieldByName('Password').Value = Edit2.Text  then
  sign2.Visible := True; //Test in this case tells the application to make Label1  
  visible if the //username and password are correct
  tblLogin.Next;
  end;
  I:= I+1;  //ends search loop of records so program can move on
  If sign2.Visible = False then
  begin
  MessageDlg('Error Username, or Password not correct',
  mtConfirmation, [mbCancel], 0);
  end
  else
  if edit3.Text &lt;&gt; edit4.Text  then
  begin
  MessageDlg('Error New Password does not match',
  mtConfirmation, [mbCancel], 0);
  end
  else
  begin
  tblLogin.Edit;
  tblLogin.FieldByName('Password').Value := Edit3.Text;
  tblLogin.Post;
  //form1.Show;
  //form4.Close;
  end;
  </code></pre>