It seems that nulling the recordsource would set grid's columns back to their default state. Instead of modifying your recordsource, you might try assigning a static recordsource (like a cursor that is defined in your form's load event [make sure to have it created when you build your grid and assign it as a record source]). Instead of
nulling the source when you change data, simply zap and append to your
static record source from a file or cursor with a matching file structure.
>Hello
>
>I have some code in the keypress event of a textbox in a grid (based on a table) and i have a command button to delete the contents of the table.
>
>what's happening is first time when form is run keypress event works fine,but when command button is clicked and grid gets refreshed by setting recordsource="" and again resetting the keypress doesn't fire.
>
>how to make the keypress to fire after the delete.
>
>
>txs
Imagination is more important than knowledge