How to set up a filter of a form

I need to setup a filter to show a specific record for a form. Acctually the form show, record by record, all records of a table, in the form now there isn’t any filter.
I use a grid to “edit” a scpeific record using the ID of the table, with a link application from grid to form, so there is a way to tell the form “do not show me all the table but only ID 12345”.

Do you know how to call the form for a sepcific ID, what does the grdi set up before call the form application ?

thanks

See there:

http://www.scriptcase.net/scriptcase-samples/tutoriais/grid/grid16.php

jsb

Thanks jsbinca,

maybe I was not clear, I already did that, call a form from a grid, on a specific record, now I need to do the same thing via code, using macro.

I already tried sc_redir( myform, id=12345 ), but doesn’t work, I guess there shoud be a way, as the grid does, to set up field ID as value 12345 so the form, once called, uses it as filter.

[QUOTE=Vincenzo;37541]Thanks jsbinca,

maybe I was not clear, I already did that, call a form from a grid, on a specific record, now I need to do the same thing via code, using macro.

I already tried sc_redir( myform, id=12345 ), but doesn’t work, I guess there shoud be a way, as the grid does, to set up field ID as value 12345 so the form, once called, uses it as filter.[/QUOTE]

Yeah, I got that feeling that I misinterpreted your post but wanted to wait for your response.
So here is the deal.
Go to the ‘Where Condition’ field of the SQL section of you form and type in:

id = [glo_id]

Now you can call your form with

sc_redir(myform, glo_id = 12345);

jsb

Thnkas, I was thinking to do a solution like what you suggested, I was thinking that there was a macro that set the key for a form, the same thing that grid does, maybe this is not available to developers.

thanks