Topic: Go to next or previous record

Hallo,

is possible make script for table navigation - first record, previous record, next record, last record in form without grid?

Thanks, Georg.

Re: Go to next or previous record

Hello johnut

To navigate between records of a grid, I use this script :

procedure Form1_bLast_OnClick (Sender: string; var Cancel: boolean);    //   Last record
begin
    Form1.GridEmployees.SelectedRow := Form1.GridEmployees.RowCount - 1;
    Form1.bFillForm.Click;
end;

procedure Form1_bNext_OnClick (Sender: string; var Cancel: boolean);     // Next record
begin
    Form1.GridEmployees.SelectedRow := Form1.GridEmployees.SelectedRow +1;
    Form1.bFillForm.Click;
end;

procedure Form1_bFirst_OnClick (Sender: string; var Cancel: boolean);     //   First record
begin
    Form1.GridEmployees.SelectedRow := 0;
    Form1.bFillForm.Click;
end;

procedure Form1_bPrev_OnClick (Sender: string; var Cancel: boolean);     //  Previous record
begin
    Form1.GridEmployees.SelectedRow := Form1.GridEmployees.SelectedRow -1;
    if Form1.GridEmployees.SelectedRow < 0 then Form1.GridEmployees.SelectedRow := 0;
    Form1.bFillForm.Click;
end;

To look pretty, I place each procedure behind a button itself behind an image.

Is it OK for you ?


JB

Re: Go to next or previous record

Thank you, this is perfect solution.
Or, i need solution with textboxs in form, without tablegrid. Is it even possible?

Georg

Re: Go to next or previous record

Here you can find the example (navigation on Form):
http://myvisualdatabase.com/forum/viewtopic.php?id=1451

Dmitry.

Re: Go to next or previous record

So this solution would not occur to me.

Спасибо