set step on >return dodefault()> into the old cmdReturn to see, what is actually happening...
messagebox("My cursor PatientDemo is "+ iif(used("CurPatientSummary"),"","not ") + "used") messagebox("My cursor is "+ iif(used("CurPatientSummary"),"","not ") + "used") messagebox("My cursor is "+ iif(used("CurOnGoingHealth"),"","not ") + "used") messagebox("My cursor is "+ iif(used("CurTreatment"),"","not ") + "used") messagebox("My cursor is "+ iif(used("CurConsultants"),"","not ") + "used") CLOSE TABLES MESSAGEBOX("Tables are closed now.")