这是代码 ::
procedure TFrm_ZuFangAddEdit.btn1Click(Sender: TObject);
begin
if Trim(edt_FangJianHao.Text)='' then
begin
MessageBox(Self.Handle,'房间编号不能为空!','提醒',MB_OK or MB_ICONINFORMATION);
edt_FangJianHao.SetFocus;
//Exit;
end;
if Trim(edt_FangDongName.Text)='' then
begin
MessageBox(Self.Handle, '房东姓名不能为空!','提醒',MB_ok or MB_ICONInformation);
edt_FangDongName.SetFocus;
Exit;
end;
if Trim(edt_FangDongPhone.Text)='' then
begin
MessageBox(Self.Handle, '房东手机不能为空!','提醒',MB_ok or MB_ICONInformation);
edt_FangDongPhone.SetFocus;
Exit;
end;
if Trim(edt_ZuKe.Text)='' then
begin
MessageBox(Self.Handle, '租客姓名不能为空!','提醒',MB_ok or MB_ICONInformation);
edt_ZuKe.SetFocus;
Exit;
end;
if Trim(edt_ZuKePhone.Text)='' then
begin
MessageBox(Self.Handle, '租客手机不能为空!','提醒',MB_ok or MB_ICONInformation);
edt_ZuKePhone.SetFocus;
Exit;
end;
//--非空判断 --------
if Frm_ZuFangAddEdit.Caption='租房信息新增' then
begin
with Frm_Data.qry_ZuFang do
begin
Append;
FieldByName('ZuFangCode').AsString:=edt_DanJuHao.Text;