I do not think you can assign code @ runtime (please someone correct me if I am wrong), but what I have done in the past is to use the EXECUTESCRIPT function with code either stored in a text file or in a memo field.
Hope this helps.
Einar
>Hi Everybody,
>
>I have an empty grid (ColumnCount = -1) on a form. In the Load event of the form I select a table, so it will be shown in the grid. How may I assign codes to the Click event of a header in a column of the grid? [let say ThisForm.Grid1.Column1.Header1.Click()]
>
>Thank you,
>Ali
Semper ubi sub ubi.