PROCEDURE FormLevelHelp() ** Check to see if there is a pageframe. If there is, we want to grab the help ** ID for whatever page we are sitting on. If not, then we want to grab the ID ** for the form itself CAUTION - This code will have to be expanded IF we ** create a pageframe INSIDE a form that doesn't cover the whole form. ** In that case, we'd want the form level help, but it may be finding the ** page instead. LOCAL lnHelpID, oObject, lo oObject = _screen.activeform IF TYPE('oObject.baseclass') # 'U' IF TYPE('thisform.ActiveControl') # 'U' ** There is an ActiveControl (most cases will hit here) oObject = thisform.ActiveControl ** Walk up the hierarchy of the activeControl until we hit ** either a page or the form level DO WHILE NOT LOWER(oObject.baseclass) = "page" AND; NOT LOWER(oObject.baseclass) = "form" oObject = oObject.parent ENDDO ELSE ** There is no ActiveControl ** Check for a pageframe and set oObject to the ActivePage ** Otherwise, by default, lnHelpID gets set to that of the form itself FOR EACH lo IN _screen.activeform.controls IF LOWER(lo.baseclass) = 'pageframe' oObject = lo.pages(lo.ActivePage) ENDIF ENDFOR ENDIF ENDIF lnHelpID = oObject.WhatsThisHelpID HELP ID lnHelpID ENDPROCYou also could try: