Vous êtes sur la page 1sur 5

Button input 1

edit1.Enabled:=true;

edit2.Enabled:=true;

edit3.Enabled:=true;

edit4.Enabled:=true;

edit5.Enabled:=true;

edit6.Enabled:=true;

edit7.Enabled:=true;

edit8.Enabled:=true;

button2.Enabled:=false;

button3.Enabled:=false;

button4.enabled:=true;

button5.enabled:=true;

edit1.setFocus;

end;

button edit 2

DBGrid1.setfocus;

with table1 do

begin

form1.Edit1.enabled:=true;

form1.Edit2.enabled:=true;

form1.Edit3.enabled:=true;

form1.Edit4.enabled:=true;

form1.Edit5.enabled:=true;

form1.Edit6.enabled:=true;

form1.Edit7.enabled:=true;

form1.Edit8.enabled:=true;
form1.Edit1.Text:=fieldvalues['NIM'];

form1.Edit2.Text:=fieldvalues['Nama'];

form1.Edit3.Text:=fieldvalues['Alamat'];

form1.Edit4.Text:=fieldvalues['Telepon'];

form1.Edit5.Text:=fieldvalues['JenisKelamin'];

form1.Edit6.Text:=fieldvalues['Prodi'];

form1.Edit7.Text:=fieldvalues['Semester'];

form1.Edit8.Text:=fieldvalues['Kelas'];

form1.Edit1.Enabled:=false;

form1.Edit2.Enabled:=false;

form1.Edit3.Enabled:=false;

form1.Edit4.Enabled:=false;

form1.Edit5.Enabled:=false;

form1.Edit6.Enabled:=false;

form1.Edit7.Enabled:=false;

form1.Edit8.Enabled:=false;

end;

form1.Show

end;

button save 4

Table1.Append;

Table1.FieldByName('NIM').AsString:=Edit1.Text;

Table1.FieldByName('NAMA').AsString:=Edit2.Text;

Table1.FieldByName('ALAMAT').AsString:=Edit3.Text;

Table1.FieldByName('TELEPON').AsString:=Edit4.Text;

Table1.FieldByName('JENISKELAMIN').AsString:=edit5.Text;

Table1.FieldByName('PRODI').AsString:=Edit6.Text;
Table1.FieldByName('SEMESTER').AsString:=Edit7.Text;

Table1.FieldByName('KELAS').AsString:=Edit8.Text;

Table1.Post;

end;

BUTTON DELETE

Table1.Delete;

edit1.Text:='';

edit2.Text:='';

edit3.Text:='';

edit4.Text:='';

edit5.Text:='';

edit6.Text:='';

edit7.Text:='';

edit8.Text:='';

end;

SAVE

Table1.Append;

Table1.FieldByName('NIM').AsString:=Edit1.Text;

Table1.FieldByName('NAMA').AsString:=Edit2.Text;

Table1.FieldByName('ALAMAT').AsString:=Edit3.Text;

Table1.FieldByName('TELEPON').AsString:=Edit4.Text;

Table1.FieldByName('JENISKELAMIN').AsString:=edit5.Text;

Table1.FieldByName('PRODI').AsString:=Edit6.Text;

Table1.FieldByName('SEMESTER').AsString:=Edit7.Text;

Table1.FieldByName('KELAS').AsString:=Edit8.Text;

Table1.Post;

end;
UPDATE

table1.locate('NIM',edit1.Text,[]);

table1.Edit;

Table1.FieldByName('NIM').Asstring:=edit1.Text;

Table1.FieldByName('nama').AsString:=edit2.Text;

Table1.FieldByName('alamat').asstring:=edit3.Text;

Table1.FieldByName('telepon').asstring:=edit4.Text;

Table1.FieldByName('jeniskelamin').asstring:=edit5.Text;

Table1.FieldByName('prodi').asstring:=edit6.Text;

Table1.FieldByName('semester').asstring:=edit7.Text;

Table1.FieldByName('kelas').asstring:=edit8.Text;

table1.post;

table1.close;

table1.open;

table1.Filtered:=false;

button5.Click;

showmessage('Data berhasil di simpan');

end;

CANCEL

edit1.Text:='';

edit2.Text:='';

edit3.Text:='';

edit4.Text:='';

edit5.Text:='';

edit6.Text:='';

edit7.Text:='';

edit8.Text:='';
end;

SEARCH

Table1.SetKey;

Table1.FieldByName('NIM').AsString :=

edit9.Text;

Table1.GotoKey;

end;