Faq #8019
Grid reconstruction and how to avoid it explains this grid behavior. The simplest fix is to set Recordsource of the grid to the empty string before PACK and restore it back to the table name after that.
Thisform.grdModicomm.Recordsource = ""
PACK
Thisform.grdModicomm.Recordsource = ...
In general, PACK command is used in maintenance routines. Is there any reason you've to use it in in this case?
>Here's another game of whats-wrong-with-my-code
>If a record has been deleted the Grid disappears after this code:
>
>*** COMMAND3.CLICK UPDATE
>Set Safety Off
>nAnswer= 0
>. blah . blah . blah
>Select ModiComm
>Set Order To Grpid
>Go Top
>ThisForm.Command4.Enabled= .T.
>ThisForm.grdModicomm.Visible = .F.
>PACK
>ThisForm.grdModicomm.Visible = .T.
>ThisForm.grdModicomm.ReadOnly=.T.
>ThisForm.grdModicomm.Refresh
>Set Safety On
>
>Edits and adds don't have this problem, What's Up?
--sb--