Activate Method
Object:tsmaintform.pageframe1.Page2
Expand/Collapse source code of procedure pageframe1.Page2.Activate Source Code
LOCAL lcAlias, iRec
SET DATASESSION TO THISFORM.DataSessionID
lcAlias = thisform.DataEnvironment.InitialSelectedAlias
IF !EMPTY(lcAlias)
	SELECT (lcAlias)
	*-THIS.grdList.RecordSource = lcAlias
ENDIF

*-- Check if any changes were made and prompt user to save
*-- if necessary before changing to List page
IF thisform.IsNewAndEmpty()
	thisform.Restore()			&& Restore will call RefreshForm
	iRec = RECNO()
	*- KEYBOARD '{UPARROW}'		&& force the grid to refresh...
	IF BOF()
		GO TOP
	ELSE
		IF iRec > RECC()
			GO BOTTOM
		ELSE
			GO iRec
		ENDIF
	ENDIF
	THIS.grdList.Refresh
ELSE
  IF thisform.DataChanged() AND thisform.AskToSave() = IDCANCEL
    thisform.pageframe1.ActivePage = 1
    RETURN
  ENDIF
  thisform.RefreshForm()
ENDIF
this.grdList.SetFocus()