*** Assumption is oApp.CurrentUser = Username USE usersets ORDER main IN 0 SELECT usersets SEEK PADR(oApp.CurrentUser,10)+PADR("Form1.Grid1.Column1",100)+PADR("C IF FOUND() THISFORM.Grid1.Column1.ColumnWidth=VAL(usersets.propset) ENDIFThis table structure works for all objects as you are not hard-wiring fieldnames for the Grid object only, see?
>SELECT User
>LOCATE FOR User.FormName = ThisForm.Name
>DO WHILE FOUND()
> loColumn = EVALUATE("This." + ALLTRIM(User.Name))
> WITH loColumn
> .ColumnOrder = User.ColumnOrder
> .Width = User.Width
> ENDWITH
> CONTINUE
>ENDDO
>SELECT CustView
><\pre>
>
>
>Thanks
>
>>Hi John ---
>>
>>Divorce the user from the OOP....If you have saved the info, then SEEK to find the right property setting and restore it as follows
>>
>>cName=THIS.Name
>>SELECT mysettings
>>SEEK m.UserID+cName
>>IF FOUND()
>> cProperty=mysettings.property
>> *** Set as appropriate...!!!
>>ENDIF
>>
>>>
>>>I have managed to save the .Width, .Name, .ColumnOrder of the columns in the grid to a table. I can't however figure out how to reference the columns using the column name stored in the table to reset the .ColumnOrder.
>>>
>>>After I find the record in the table for that grid how do I use the User.ColumnName that is stored in the table in the "This." statement?
>>>
>>>This."User.ColumnName".ColumnOrder = User.ColumnOrder
>>>
>>>Each attempt results in an syntax error...
>>>
>>>Thanks
>>>
>>>>And/or Release. Not Destroy, though, IMHO.
>>>>
>>>>>
>>>>>Would the Destroy event be the same as the QueryUnload? I see that the QueryUnload is not called if you invoke the forms Release method, could this be a potential problem?
>>>>>
>>>>>Thanks
>>>>>
>>>>>>Hi John ---
>>>>>>
>>>>>>There's no easy answer to this. You could store these properties to a table on QueryUnload and restore them at Form Init. Or substitute the table for registry settings or INI settings.
>>>>>>
>>>>>>
>>>>>>>How can I store the ColumnOrder and Width when the user modifies a grid?
>>>>>>>
>>>>>>>Thanks------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05