LPARAMETERS lcAuthType, llAlreadyHaveThisAuthType llAlreadyHaveThisAuthType = INDEXSEEK(lcAuthType, .F., "Auth", "AuthType") WITH THISFORM.CommandGroup1 .Command2.Enabled = !llAlreadyHaveThisAuthType .Command4.Enabled = !llAlreadyHaveThisAuthType atct = llAlreadyHaveThisAuthType ENDWITHNote that there is no change in the SELECTed table, no change in the current index, and no movement of the record pointer. All you do is Enable/Disable your CommandGroup buttons and set your atct. The WITH...ENDWITH saves a little processing because VFP only has to figure out the object reference once.
>LPARAMETERS lcAuthType >SELECT auth >SET ORDER TO authtype >SEEK lcAuthType >IF FOUND() > ThisForm.Commandgroup1.Command2.Enabled = .F > ThisForm.CommandGroup1.Command4.Enabled = .F. > atct = .T. >ELSE > ThisForm.Commandgroup1.Command2.Enabled = .T. > ThisForm.CommandGroup1.Command4.Enabled = .T. > atct = .F. >ENDIF >SET ORDER TO main >SELECT authtype