Hello all! I have discovered the usefulness of the Sender Object, but am having a little problem! I only want the following code to run if the user presses the OK button on my form:
procedure TfrmVenMaint.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
if Sender = ????? then
if JMSData.dsVenMaint.State = dsEdit then
If MessageDlg('Do you want to save your changes?',mtConfirmation, [mbYes, mbNo], 0) = mrNo then
JMSData.dsVenMaint.DataSet.Close
else
JMSData.qryVenMaint.Post;
end;
So, if they have entered a value and it hasn't posted and they press the OK button then ask for confirmation.
Form = frmVenMaint
bitbtn = btnOK (btnOKClick calls frmVenMaint.Close
So can anyone tell me what I need in the ????? to make this work? Thanks! Leslie
landrews@metrocourt.state.nm.us
SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
procedure TfrmVenMaint.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
if Sender = ????? then
if JMSData.dsVenMaint.State = dsEdit then
If MessageDlg('Do you want to save your changes?',mtConfirmation, [mbYes, mbNo], 0) = mrNo then
JMSData.dsVenMaint.DataSet.Close
else
JMSData.qryVenMaint.Post;
end;
So, if they have entered a value and it hasn't posted and they press the OK button then ask for confirmation.
Form = frmVenMaint
bitbtn = btnOK (btnOKClick calls frmVenMaint.Close
So can anyone tell me what I need in the ????? to make this work? Thanks! Leslie
landrews@metrocourt.state.nm.us
SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned