this.Enabled = ( reccount( "YourCursor/TableHere" ) > 0 )>What bothers me most though, is that calling the SetFocus fires the .Page.Activate event.
************************************************** *-- Form: form1 (c:\vfp8app\misc\grdhighlight2.scx) *-- ParentClass: form *-- BaseClass: form *-- Time Stamp: 05/16/04 11:05:01 AM * DEFINE CLASS form1 AS form Top = 0 Left = 0 Height = 315 Width = 570 DoCreate = .T. Caption = "Form1" Name = "Form1" ADD OBJECT pageframe1 AS pageframe WITH ; ErasePage = .T., ; PageCount = 2, ; Top = 14, ; Left = 6, ; Width = 532, ; Height = 287, ; Name = "Pageframe1", ; Page1.Caption = "Page1", ; Page1.Name = "Page1", ; Page2.Caption = "Page2", ; Page2.Name = "Page2" ADD OBJECT form1.pageframe1.page2.grid1 AS grid WITH ; Height = 195, ; Left = 16, ; Top = 14, ; Width = 338, ; HighlightStyle = 2, ; Name = "Grid1" ADD OBJECT form1.pageframe1.page2.command1 AS commandbutton WITH ; Top = 117, ; Left = 397, ; Height = 27, ; Width = 84, ; Caption = "Command1", ; Name = "Command1" PROCEDURE Load create cursor x1 ( i1 i, i2 i ) for i = 1 to 20 insert into x1 values ( 1, 1 ) endfor go top ENDPROC PROCEDURE command1.Click this.Parent.grid1.SetFocus() ENDPROC ENDDEFINE * *-- EndDefine: form1 **************************************************