Topic: please help - record button is triggered strangely

In a form in my application, the record record button is activated unconditionally. I put a confirmation message on that record button. When another button, for example printing, is clicked on this form, the save confirmation message is displayed. I have already examined the script and everything is correct.
Did MVD always record the record in this type of situation and was that evident when I put the confirmation message? Has anyone ever experienced this?

Roberto Alencar

Re: please help - record button is triggered strangely

When you press a Report button on form for add or edit record, the Report button automatically press a button with action "Save record", because report gets data from the database, not from form,in this way you always get actual data from form.

Dmitry.

Re: please help - record button is triggered strangely

Dear sir,
              I am facing such situation which you have described in your reply. Any solution? Report button will work only to create report and not save record.

Re: please help - record button is triggered strangely

unforgettable wrote:

Dear sir,
              I am facing such situation which you have described in your reply. Any solution? Report button will work only to create report and not save record.

Create events OnClick and OnAfterClick for the report button, where you can temporally disable action of button to prevent saving a record, example:


procedure frmAbonent_ButtonReport_OnClick (Sender: TObject; var Cancel: boolean);
begin
    frmAbonent.ButtonSave.dbActionType := adbNone;
end; 

procedure frmAbonent_ButtonReport_OnAfterClick (Sender: TObject);
begin
    frmAbonent.ButtonSave.dbActionType := adbSaveRecord;
end;
Dmitry.

Re: please help - record button is triggered strangely

Thank you sir. These codes work properly. Thank you again.