M
machinxing
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TfrmRoomBalance.DBEdit1Change(Sender: TObject); begin with DM, DM.qryVIP do begin if qryVIP.Active then begin if (DBText7.Caption = qryVIP.FieldByName('VIPName').AsString) then DBedit2.Text := FloatToStr(StrToFloat(DBedit1.Text)* (qryVIP.FieldByName('Discount1').AsFloat)) end; end; end; 想法很简单:判断dbtext7的值是否与表vip中vipname相同,相同则执行dbedit1*discount1(vip中的字段) 这样写对吗?