>>Just This....
>>
>>OPEN DATABASE ".\dados\restaurant" shared
>>SELECT codigo,garcom FROM mesas INTO CURSOR openmesas WHERE status = .t.
>>thisform.grid1.RecordSource="openmesas"
>>
>>thisform.grid1.column1.Width= 40
>>thisform.grid1.column2.Width= 110
>>thisform.grid1.column1.text1.Click
>
>When you set grid.recordsource your grid automatically 'rebuilds itself' losing all customization. You may consider doing it differently. Create empty cursor in Form.Load event and assign it as Grid.recordsource in Grid.Init event, assigning all column.controlsources after it. When it is done, use Insert... Select command in Form.Init event keeping grid properties intact:
>
>Insert Into openmesas (garcom) Select gracom From mesas Where status=.T.
>Go Top In openmesas
>This.Grid1.Setfocus
>
I agree that you should move this to the Load(), but you should also not be calling the Init() once you are in the form. It is only called when the form is first instantiated. I use a custom method called RequeryData() which will get data and then copy that data into the cursor which was created in the Load().
HTH!
Carsten M. Thode