Topic: show record using script?

sir, how to show record using script when click a button?

Re: show record using script?

I have made example for you.

procedure Form1_Button5_OnClick (Sender: string; var Cancel: boolean);
var
    sID: string;
    sDate: string;
begin
    if Form1.GridEmployees.dbItemID<>-1 then // if there is selected record in TableGrid
    begin
        sID := Form1.GridEmployees.sqlValue; // id of record for show
        frmEmpScript.edLastName.Text:= SQLExecute('SELECT lastname FROM employees WHERE id='+sID); // get lastname
        frmEmpScript.edFirstName.Text:=SQLExecute('SELECT firstname FROM employees WHERE id='+sID); // get firstname

        // date
        sDate := SQLExecute('SELECT dateofbirth FROM employees WHERE id='+sID);
        if sDate <>'' then frmEmpScript.DateTimePicker1.Date := SQLDateTimeToDateTime (sDate)
        else frmEmpScript.DateTimePicker1.Checked:= False;

        frmEmpScript.ShowModal; // show form
    end;
end;
Post's attachments

Attachment icon ShowRecord by script.zip 6.09 kb, 646 downloads since 2015-02-03 

Dmitry.

Re: show record using script?

And how to display the records into a grid when getting the variable from a textbox?

Re: show record using script?

tcoton wrote:

And how to display the records into a grid when getting the variable from a textbox?

I think the same question, to which I replied at this topic
http://myvisualdatabase.com/forum/viewtopic.php?id=1118

Dmitry.

Re: show record using script?

Yes it is, sorry for the double post